[no-unused-vars] False positive because React JSXIdentifier nodes are ignored #868
Labels
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
triage
Waiting for team members to take a look
Repro
Expected Result
There should be no error for Foo, because it is used in the expression
<Foo />
.Actual Result
The error is reported.
Additional Info
In the AST, the reference appears inside a
JSXIdentifier
node like this:Whereas the rule only considers regular
Identifier
nodes:typescript-eslint/packages/eslint-plugin/src/rules/no-unused-vars.ts
Lines 42 to 72 in 5eb40dc
Versions
@typescript-eslint/eslint-plugin
2.0.0
@typescript-eslint/parser
2.0.0
TypeScript
3.5.2
ESLint
6.1.0
node
8.15.0
npm
6.4.1
The text was updated successfully, but these errors were encountered: