-
-
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
Fixed the ParseResult
type in @babel/core
#14333
Conversation
type AstRoot = t.File | t.Program; | ||
|
||
export type ParseResult = AstRoot; | ||
export type ParseResult = ReturnType<typeof parse>; |
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 represents something like:
type ParseResult = File & {
errors: ParseError[];
}
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/51409/ |
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.
Note that @babel/core
types are not published, so if you are using them they may come from DefinitelyTyped.
That might be right - should I also prepare a PR to the DefinitelyTyped then? |
Yes please! (even if we don't maintain those type definitions) |
I've created a corresponding PR to DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#59153 |
Fixes #1, Fixes #2
Those types IMHO should be consistent since
@babel/core
just~ calls to@babel/parser
here.