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: yoda exceptRange false positives on empty string property names #12071
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.
Changes LGTM, thanks!
Just for my understanding, all of the invalid
test cases would pass even with the current rule code, right?
Yes! Those are just regression tests for this PR. |
I've reproduced here. Marking as accepted. |
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 for working on this!
Merged. Thanks for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Bug fix
This small bug fix can produce only fewer warnings.
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
No errors.
What actually happened? Please include the actual, raw output from ESLint.
1 error
What changes did you make? (Give an overview)
getStaticPropertyName()
return value is now explicitly compared tonull
, because it can be a valid empty string value.Is there anything you'd like reviewers to focus on?