-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Improve @babel/parser
AST types
#16425
Improve @babel/parser
AST types
#16425
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56742 |
1de8c37
to
7a056be
Compare
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.
👍
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.
It seems that the CI error has been fixed in main, can you rebase?
7a056be
to
7455f64
Compare
Fixes #1, Fixes #2
@babel/parser
's AST types usedNode
as a base class for every node, effectively making it equivalent to "any" for nodes (since it hadtype: string
). This PR replaces it with a proper union of all the possible nodes, like we do in@babel/parser
.I was experimenting with merging our type definitions in
@babel/parser
, and@babel/types
, but it might not be possible because:@babel/parser
has more nodes (ESTree, placeholders)@babel/types
has node locations as optionalI will still try to add a test to assert that the types are samewhat compatible, in a future PR.