Add support for `#x in obj` private-in syntax
See original GitHub issueThe 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.
- Ecma262 update: tc39/ecma262#2290
- ESTree update: estree/estree#252
Maybe we just merge https://github.com/estree/estree/blob/master/stage3/private-fields-in-in.md into es2022.md. - Acorn update: acornjs/acorn#1068
-
eslint-visitor-keys
update:
Maybe we have no task on it. -
espree
update: https://github.com/eslint/espree/pull/521 -
eslint-scope
update:
Maybe we have no task on it. -
eslint
update:
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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Private class features - JavaScript - MDN Web Docs - Mozilla
Class fields are public by default, but private class members can be created by using a hash # prefix. The privacy encapsulation of...
Read more >oop - JavaScript private methods
After this is executed any object created with new Foo() is going to have an eval method which can be called to return...
Read more >9. Classes — Python 3.11.1 documentation
Class objects support two kinds of operations: attribute references and instantiation. Attribute references use the standard syntax used for all attribute ...
Read more >Object expressions and declarations
class C { private fun getObject() = object { val x: String = "x" } fun ... In all these cases, members added...
Read more >Using the this Keyword (The Java™ Tutorials > Learning ...
Each argument to the constructor shadows one of the object's fields — inside the constructor x is a local copy of the constructor's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Open source doesn’t follow predictable schedules. 😃
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:These are very edge cases, though.