Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-unused-vars] false positive when imported type used inside a function with parameter with the same name #1918

Closed
ShPelles opened this issue Apr 19, 2020 · 1 comment
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@ShPelles
Copy link

Repro

{
    "rules": {
        "no-unused-vars": "off",
        "@typescript-eslint/no-unused-vars": ["error"]
    }
}
import { myType } from './myModule';

function fn(myType: myType) {
    const myVar: myType = 1234;
}

Expected Result
No linting issue is raised

Actual Result
Linter raises an error: 'myType' is defined but never used. eslint(@typescript-eslint/no-unused-vars) [1, 10]

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.28.1-alpha.0
@typescript-eslint/parser 2.28.0
TypeScript 3.8.3
ESLint 6.8.0
node 10.15.3
npm 6.4.1
@ShPelles ShPelles added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Apr 19, 2020
@ShPelles ShPelles changed the title [no-unused-vars] false positive when used inside a function with parameter with the same name [no-unused-vars] false positive when imported type used inside a function with parameter with the same name Apr 19, 2020
@bradzacher
Copy link
Member

See #1856

Please use the search before filing an issue.

@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Apr 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants