8000 Bug: no-unused-vars does not account for references in JsDoc · Issue #8902 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Bug: no-unused-vars does not account for references in JsDoc #8902
Closed as not planned
@matthieusieben

Description

@matthieusieben

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

not-applicable

Repro Code

// a.ts
export type Foo = { bar: 42 }
// b.ts
import { Foo } from './a.js'

/**
 * @see {@link Foo.bar}
 */
export function example () {}

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/no-unused-vars": ["error"],
  },
};

tsconfig

{
  "compilerOptions": {
  }
}

Expected Result

Foo is used in JsDoc, and correctly references the original definition in vs-code (alt + click goes to the definition)

Actual Result

@typescript-eslint/no-unused-vars considers this is an unused var, while typescript does not.

Additional Info

Note that if the reference is removed from the JSdoc, typescript starts complaining about an unused var as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existslocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: 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

      0