Replies: 3 comments
-
Thanks for bringing this to light! I think this could be the default behavior without any option. We already skip some cases like unused parameters preceding a used parameter. It's kind of related. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yeah, this one feels like a deal breaker to me. The only way to work around this is to label it with |
Beta Was this translation helpful? Give feedback.
0 replies
-
I opened #1910 to address this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A common pattern to omit keys from an object is to spread it like so:
This is effectively equivalent to:
Except that it's an immutable way of doing it, and doesn't violate the
performance.noDelete
rule.Unfortunately, the
correctness/noUnusedVariables
rule currently (and correctly) flags this syntax as a violation, as themodel
andyear
variables now become unused.I'm wondering if maybe there could be an option on the
correctness/noUnusedVariables
rule toignoreRestSiblings
or something like that? ESLint has it here: https://eslint.org/docs/latest/rules/no-unused-vars#ignorerestsiblingsBeta Was this translation helpful? Give feedback.
All reactions