Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: no-unused-vars should not be flagged on imports used in@link etc. #10873

Closed as duplicate of#9435
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
@LukeAbby

Description

@LukeAbby

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.7.2&fileType=.tsx&code=KYDwDg9gTgLgBDAnmYcCiICGBbMAbVAXjgEYAmAZgG4BYAKHoEtdp4kU4BvdLXAuTAGc4AGUYA7ANbAAJgBVkqAL5wAZlAjY4AIgB0AeglgArjG316%2BgFRX6cK1wACeCZNGvZClCtXQ4M4BhMRjxBXTsrfSA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tidmUQAmtAG4BDaKgyRE0aB2iRwYAL4hlQA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3QAacDQD00qPFgATDugBK6ErFRsCxClCJL0RdAA88kKQF8QVoA&tokens=false

Repro Code

import{LinkedType}from"./someFile"/** * {@link LinkedType} */

ESLint Config

{"rules":{"@typescript-eslint/no-unused-vars":"error"}}

tsconfig

Expected Result

I expected no error because while the import is unused outside of@links I consider this a valid usage of the import. Notably tsc itself recognizes this pattern and does not give an unused variable warning. Switching all links to the much less elegant{@link import("./someFile").LinkedType | LinkedType} seems unideal when it's done many times and introducing a helper type just reintroduces the no-unused-vars error.

Actual Result

The error'LinkedType' is defined but never used. appears.

Additional Info

In TSDoc I believe the applicable tags are@link,@inheritDoc, and@see. In JSDoc as a whole it applies to any tags that could include a type. I believe that would be@type,@param,@typedef,@returns,@property,@this,@throws,@yields, and synonyms.

Important note: I strongly believe this should only apply toimports. This is because if you happen to write{@link SomeUnusedThing} in the same fileSomeUnusedThing is defined it could mask the fact thatSomeUnusedThing is, well, unused.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp