Closed ehrencrona closed 3 years ago
Just fyi, in your array example, you don't need to bypass this rule:
const [ , myVar ] = array
is how I do it.
Those who voted for allow - since it's a pretty close tie - why did you vote for allow? what use are the unused variables?
I vote for this rule with the given exception. I sometimes find it better to know what the unused variable is in a destructuring.
@ehrencrona lets do this thing. Do you have a PR?
Those are the only two projects to worry about
Disallow unused variables.
Describe the reason for the rule Unused variables can indicate bugs and dead code.
They should be allowed in function declarations where they can help clarify what parameters are expected. This can be done through
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }]
There is ~only a single~ no instance in the code where I would say the error is inappropriate ~(in an array destructuring along the lines of
const [_, myVar] = array
)~ (as antony pointed out below, there are better ways of writing this)Examples Please include an example of a block of code:
Poll