Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for #x in obj private-in syntax #14811

Closed
6 of 7 tasks
ota-meshi opened this issue Jul 20, 2021 · 10 comments · Fixed by #15060
Closed
6 of 7 tasks

Add support for #x in obj private-in syntax #14811

ota-meshi opened this issue Jul 20, 2021 · 10 comments · Fixed by #15060
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint new syntax This issue is related to new syntax that has reached stage 4
Projects

Comments

@ota-meshi
Copy link
Member

ota-meshi commented Jul 20, 2021

The version of ESLint you are using.

7.31.0

The problem you want to solve.

Support Ergonomic brand checks for Private Fields (#x in obj syntax) officially, as it has reached stage-4.
refs:
https://github.com/tc39/proposals/blob/master/finished-proposals.md
https://github.com/tc39/proposal-private-fields-in-in

Your take on the correct solution to problem.

Are you willing to submit a pull request to implement this change?

It's difficult for me to change the parser.
I may be able to do other necessary work.

@ota-meshi ota-meshi added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Jul 20, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Jul 20, 2021
@nzakas nzakas added new syntax This issue is related to new syntax that has reached stage 4 and removed triage An ESLint team member will look at this issue soon labels Jul 20, 2021
@nzakas nzakas moved this from Needs Triage to Blocked in Triage Jul 20, 2021
@nzakas
Copy link
Member

nzakas commented Jul 20, 2021

The ESTree syntax is effectively done, just waiting for one last 👍.

Next we are blocked on Acorn

@nzakas nzakas added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jul 20, 2021
@nzakas nzakas changed the title Add support for #x in obj syntax Add support for #x in obj private-in syntax Jul 20, 2021
@ota-meshi
Copy link
Member Author

I tried the rules of ESLint using acorn which built the source in github repo. But I couldn't find the rule that needed to be changed.
Do you think there are rules that need to be changed?

@mdjermanovic
Copy link
Member

With #x in obj syntax, #x can appear in expressions without preceding ., and it generally can be adjacent to other tokens on its left side, so this might be seen as a false negative:

/* eslint space-unary-ops: ["error", { "words": false }] */

class C {
    #x;
    *foo(bar) {
        yield #x in bar;
    }
}

These are very edge cases, though.

@nzakas
Copy link
Member

nzakas commented Sep 14, 2021

It looks like we are just on the last step here?

@nzakas nzakas moved this from Blocked to Ready to Implement in Triage Sep 14, 2021
@mdjermanovic
Copy link
Member

Espree needs to update Acorn version. Acorn hasn't released this change yet (v8.5.0 includes class static blocks, but not this syntax).

@ljharb
Copy link
Sponsor Contributor

ljharb commented Sep 14, 2021

That's strange, class static blocks have been stage 4 for a week, but class private fields with in for months.

@nzakas
Copy link
Member

nzakas commented Sep 15, 2021

Open source doesn’t follow predictable schedules. :)

@ljharb
Copy link
Sponsor Contributor

ljharb commented Sep 15, 2021

ha, true enough :-)

@nzakas nzakas moved this from Ready to Implement to Pull Request Opened in Triage Oct 7, 2021
@mkubilayk
Copy link

Acorn 8.6 is just released and includes the necessary change: https://github.com/acornjs/acorn/releases/tag/8.6.0.

@ota-meshi
Copy link
Member Author

@mkubilayk Thanks for letting me know!

Triage automation moved this from Pull Request Opened to Complete Nov 21, 2021
@btmills btmills unpinned this issue Nov 21, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 21, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint new syntax This issue is related to new syntax that has reached stage 4
Projects
Archived in project
Triage
Complete
Development

Successfully merging a pull request may close this issue.

5 participants