-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 node type definitions to avoid any's in generated types #11687
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7470c76:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/23665/ |
value: { | ||
validate: assertNodeType("StringLiteral"), | ||
}, | ||
}, |
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.
This is technically a breaking change, but this node is so new that I'd be fine with considering it a bug fix.
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.
I think generally such changes should be considered a bug fix because the validator should try its best to align with the parser behaviour.
d05cfaa
to
7470c76
Compare
rebased it on current master(resolving conflicts because of prettier update) |
Thanks! |
comments: { | ||
validate: assertEach(assertNodeType("Comment")), | ||
optional: true, | ||
}, |
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.
Just FYI this seems to have broken Jests toMatchInlineSnapshot
matcher for tests written in TypeScript (jestjs/jest#10208)
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.
good catch, this is not intended, effect… probably this should be considered a breaking change and so to go to babel 8
Updates node type definitions in babel-types, to avoid
any
in generated types.