-
-
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
Fix: camelcase destructure leading/trailing underscore (fixes #9700) #9701
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.
LGTM. I tested this on my project that's failing linting on 4.13.0. More details in the Issue. Thanks for fixing this!
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!
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!
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
See #9700.
What changes did you make? (Give an overview)
The camelcase rule has a subtle requirement that we keep track of both the original property/identifier name, as well as a version of the name with leading and trailing underscores stripped out. During review, we missed that the original property/identifier name was being checked in the new destructuring case.
This pull request should be followed with a chore to ensure that all underscore checks will strip leading/trailing underscores, to make future contributions to this rule easier.
Is there anything you'd like reviewers to focus on?
I've added a few different test cases. Have I missed anything?