-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Support ESTree AccessorProperty #17082
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
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58657 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For class properties, we didn't enable their ESTree AST by default in the parser because there was a high risk of people relying on the old AST. Do you think there is a similar risk? What should we do if classFeatures
of the ESTree plugin is not set to true?
Good question. IIRC the For any new proposals, we should forward the AST design to the ESTree and implement them in the |
node.parent.key === node && | ||
!node.parent.computed | ||
(parent.type === "AccessorProperty" || | ||
parent.type === "ClassAccessorProperty") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this second check for BABEL_8_BREAKING
Does this also fix #15188 ? |
* feat: create AccessorProperty for ESTree * add new test cases * add private key test case * update Babel 8 test fixtures * support AccessorProperty in eslint-* * guard accessor property rename by classFeatures * update parser options schema * address review comments
The
AccessorProperty
is part of the stage 3 ESTree decorators spec, which is already supported by typescript-eslint.