improve node type definitions to avoid any's in generated types#11687
improve node type definitions to avoid any's in generated types#11687nicolo-ribaudo merged 4 commits intobabel:masterfrom
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.
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.
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.
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.
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
anyin generated types.