-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: no-self-assign false positive with rest and spread in array #12099
Fix: no-self-assign false positive with rest and spread in array #12099
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.
Thanks, this generally seems like a good idea to me! Can we add a test case for Whoops, this isn't valid syntax. Please ignore![...a, b] = [...a, 1]
?
I have verified this bug using our demo. |
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 contributing!
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 to ESLint! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Bug fix
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 as this is not a self assign.
What actually happened? Please include the actual, raw output from ESLint.
'a' is assigned to itself no-self-assign
errorWhat changes did you make? (Give an overview)
Skip comparing a rest element if it isn't vs the last element.
Is there anything you'd like reviewers to focus on?