Unexpected "'Type' is declared but its value is never read." error with jsdoc @import syntax #60908
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
π Search Terms
jsdoc
@import
"is declared but its value is never read"π Version & Regression Information
I have seen this error since the introduction of
@import
in jsdoc comments (TS 5.5 if i recall correctly)β― Playground Link
No response
π» Code
I made a testcase repo https://github.com/DavidBruant/jsdoc-import-unused-testcase
It is as reduced as a managed to make it
The code :
The types.d.ts file:
π Actual behavior
tsc
and VSCodium both say:π Expected behavior
There shouldn't be an error because of the line using the type :
/** @type {Set<ImportedType>} */
We've had this error in plently of places. It also seems like it occurs more regulary when the type is used within a generics
Additional information about the issue
For some reason, removing
function id() { return undefined }
from the code solves the problem while it seems completely unrelated to the problemThe text was updated successfully, but these errors were encountered: