-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve @babel/core typings #17471
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/core typings #17471
Conversation
| sourceMaps, | ||
|
|
||
| // babel-generator does not differentiate between `true`, `"inline"` or `"both"` | ||
| sourceMaps: !!sourceMaps, |
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.
Here we cast generatorOpts.sourceMaps to boolean as required by the @babel/generator.
383d697 to
50a8795
Compare
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59842 |
| "private": true, | ||
| "type": "module", | ||
| "devDependencies": { | ||
| "$repo-utils": "link:../scripts/repo-utils", |
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 a private package and will probably never be published, so we simply add $repo-utils here.
| parserOpts?: ParserOptions; | ||
| // Deprecate top level generatorOpts | ||
| // Todo(Babel 9): Deprecate top level generatorOpts | ||
| generatorOpts?: GeneratorOptions; |
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.
The todo items have been here since 8 years ago, but I am not sure if we want to do it in Babel 8.
|
commit: |
6d4abc9 to
4b8fe00
Compare
The error will not be printed if failed fast
The size reduction comes from terser upgrade in the previous commit
4b8fe00 to
a80e2d8
Compare
In this PR we improved the typings of
@babel/core: For every functional properties inInputOptionsandPluginObject, it is now annotated with specific signatures. We also fixed incorrect typings in theloadOptionsAPI.We also added a new typing export for
@babel/traverse:VisitWrapper, used by theInputOptions#wrapPluginVisitorMethod. There is no new typing export from@babel/corethough.Also specified
terseras devDependency since it is required by the@babel/helpersbuild scripts.