Description
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
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 @link
s 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 to imports. This is because if you happen to write {@link SomeUnusedThing}
in the same file SomeUnusedThing
is defined it could mask the fact that SomeUnusedThing
is, well, unused.