-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve @babel/parser error typing
#17521
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 error typing
#17521
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60024 |
|
commit: |
| parser.state.strict = true; | ||
| } | ||
| return parser.getExpression() as unknown as ParseResult<Expression>; | ||
| return parser.getExpression() as ParseResult<Expression>; |
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.
ParseResult<Expression> doesn't declare properties like .comments correctly, could you improve it by the way? :)
448e3f5 to
00d723e
Compare
a8305f6 to
4c8f0b0
Compare
liuxingbaoyu
left a comment
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.
Great!
4c8f0b0 to
b76b6ba
Compare
a38d6f9 to
fbbed6f
Compare
fbbed6f to
dfb68b6
Compare
In this PR we create the
ParseErrorfrom the genericParseErrorinterface, which provides complete parse error properties.The
File -> ParseResult<File>casting is also moved to the top levelparse()method.