[no-unused-vars] False positive on function parameter decorator with default value #2394
Labels
duplicate
This issue or pull request already exists
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
scope analyser
Issues that are caused by bugs/incomplete cases in the scope analyser
Reproduction
I noticed that when the
@typescript-eslint/no-unused-vars)
rule is enabled (eitherwarn
orerror
mode) :it triggers a false positive for function parameter decorators when the parameter for which it's used has a default value.
For example, in the following code case:
the
Query
decorator will be marked as unused (Line 1). But if we remove the default'bar'
value, then there is no more false positive.Expected Result
The linter shouldn't raise a warning/error on such circumstances.
Actual Result
The linter raises a warning/error.
Additional Info
I've created a reproduction repository with the above example.
Versions
@typescript-eslint/eslint-plugin
3.9.0
@typescript-eslint/parser
3.9.0
TypeScript
3.9.7
ESLint
7.6.0
node
12.18.3
npm
6.14.6
The text was updated successfully, but these errors were encountered: