-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Whitelist recovered babel parse errors #10495
Conversation
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 it is annoying to have to update this every time a new error message is added to Babel. What is the purpose of this change?
@sosukesuzuki We discussed this in #9979. The idea is to allow only specific errors and rethrow anything else. I didn't expect the list to be so long, but it seems to make sense.
It's vice versa. Now we have to monitor when Babel adds new recoverable errors and either add support for them or rethrow them, i.e. update the current blocklist. After this change, the new list will be updated only when we deliberately decide to support some specific case of error recovery. |
I will also try clean this list later, I want keep this PR small. |
I got it! It makes sense. Btw, I don't like Babel error messages are hard coded. It may be good to introduce error code for recoverable errors at Babel side. What do you think? |
Yes, that would be great, but I guess it's not doable... because some messages are from babel plugin. |
The Babel parser plugin isn't external code, so it may be possible. I'll look into it. |
Description
Some listed errors still should throw, but we can fix them later.
I believe this may also break some valid case, for example legacy things in non-strict mode, maybe we can try parse as non-strict if find it's necessary.
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨