[no-unused-vars] Imports marked as unused if a method argument has the same name #2402
Closed
3 tasks done
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
We're using TypeScript in an AngularJS project. The AngularJS dependency injection uses the argument names to inject the service. The registered service names and implementations usually have the same name. This results in function like those:
The import will be marked as unused by typescript/no-unused-vars
Repro
https://github.com/ago1024/typescript-eslint-unused-vars-import
Expected Result
The imported SomeService type in test.ts:1 should not be marked as unused.
Actual Result
The SomeService import in line 1 is marked as unused
Versions
@typescript-eslint/eslint-plugin
3.9.1
@typescript-eslint/parser
3.9.1
TypeScript
3.9.7
ESLint
7.7.0
node
10.14.1
The text was updated successfully, but these errors were encountered: