Skip to content

[no-unused-vars] Wrong position reported #4910

Closed
@bachorp

Description

@bachorp

Repro

{
    "parser": "@typescript-eslint/parser",
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
        "@typescript-eslint/no-unused-vars":
            "error"
    }
}
function foo(x: null) {
    return x
}

let x = null

x = foo(x)

Expected Result

7:1  error  'x' is assigned a value but never used.  @typescript-eslint/no-unused-vars

x = foo(x)
^ error here

Actual Result

7:9  error  'x' is assigned a value but never used.  @typescript-eslint/no-unused-vars

x = foo(x)
        ^ error here

Versions

package version
@typescript-eslint/eslint-plugin 5.22.0
@typescript-eslint/parser 5.22.0
TypeScript 4.6.2
ESLint 8.14.0
node 16.12.0

Metadata

Metadata

Assignees

Labels

accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy