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
Fix: require-await crash on global await #12571
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.
Can you add a test which will trigger the for-await-of in top-level scope? Otherwise it seems that the change in ForOfStatement might not be needed.
I was being lazy. Thanks for not letting me 😄 |
For posterity, top-level |
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.
LGTM, thanks!
Thanks for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Bug fix (template)
What changes did you make? (Give an overview)
@typescript-eslint/parser
allows globalawaits
.This currently rule assumes that is not allowed, because espree throws a parsing error on it.
This PR just stops the rule from crashing on global await statements.
Related: typescript-eslint/typescript-eslint#1077