-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ESLint: Enable ignoreRestSiblings
option for no-unused-vars
rule
#41897
ESLint: Enable ignoreRestSiblings
option for no-unused-vars
rule
#41897
Conversation
Size Change: +148 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
ca4190c
to
b8cf990
Compare
b8cf990
to
06896d7
Compare
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.
Thought I'd leave it up for discussion, but looks like no one is opposed (yet)! I guess we can land it then. It's probably good to have in place, given that this is a common pattern and we won't have the Lodash omit
as an escape hatch anymore.
I think we can forgo a components
changelog for this one, but I'd say it's worth mentioning in the eslint-plugin
changelog.
Good call, added one.
Well, I'll leave it up for now, and land it next week so if anyone has objections they can raise them in the meantime. |
What?
This PR enables the
ignoreRestSiblings
option of theno-unused-vars
ESLint rule in order to allow for declaring unused variables when using spread during destructuring. Previously, we had to ignore that rule to allow this, so this PR cleans those ignores up as well.Why?
Declaring a variable in order to spread the rest of the object during destructuring is a common way to omit properties out of objects in modern JavaScript and it should be allowed by our linter.
This came up in a review by @mirka here: #41865 (comment)
How?
We're specifically enabling the
ignoreRestSiblings
option for theno-unused-vars
rule, and removing all prior rule ignore comments that are no longer necessary.Testing Instructions
Question
@ciampo @mirka we're removing a couple of ESLint rule ignore comments from the components package - does this need a CHANGELOG entry? Let me know, and I'm happy to add one.