-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update: Allow space-unary-ops
to handle await expressions
#7174
Conversation
LGTM |
@not-an-aardvark, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @qmmr and @gyandeeps to be potential reviewers |
07528a9
to
aca16d6
Compare
LGTM |
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, thank you!
Ah, this is an enhancement of
|
Endorsed via 👍 to the original PR comment. |
LGTM 👍 |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Please check each item to ensure your pull request is ready:
See #7101 for context. Now that async functions can be parsed by
acorn
, this fix allowsspace-unary-ops
to detectawait
expressions.What rule do you want to change?
space-unary-ops
Does this change cause the rule to produce more or fewer warnings?
More, although it is not expected to break anyone's code since
await
expressions couldn't be parsed by Espree until a few hours ago.How will the change be implemented? (New option, new default behavior, etc.)?
This would allow
await
expressions to be checked byspace-unary-ops
, in the same manner asyield
expressions.This would work the same way as
yield
currently does, i.e.await
would be part of thewords
option, and it would be possible to specify{await: true}
or{await: false}
as an override.Please provide some example code that this change will affect:
What does the rule currently do for this code?
await
expressions are currently not linted at all.What will the rule do after it's changed?
The rule will report
await
expressions that are not followed by a space (in the same way that it currently reportsyield
expressions).What changes did you make? (Give an overview)
(Implements the behavior above)
Is there anything you'd like reviewers to focus on?
Would this change break cause errors for users who have been using
babel-eslint
? If so, is it still semver-minor?