-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unexpected "'Type' is declared but its value is never read." error with jsdoc @import syntax #60908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interestingly, I can't repro it using the bug workbench: workbench |
I think I have the same problem.
|
While we wait for the fix to be merged, here is a (surprising) workaround: /**
* @import { Page } from "playwright"
*/
'ignore';
// ... |
I see that TypeScript 5.8.3 has recently been released When i compare 5.8.2 and 5.8.3, i can see the commit ee3dd72 which was the result of merging #60921 if i understand correctly so i expected the bug described in this issue to be fixed However, i did the reproduction steps in the testcase repo (i updated TS to 5.8.3) I'm not sure where the problem is Maybe i misunderstood the pull request If anyone sees this message, can you check whether the issue is fixed on your end, please? Thank you π |
I've tested my example #60908 (comment). I still get the error with TypeScript 5.8.3. |
I'd love to reopen this issue but don't have the permissions to @jakebailey could you to reopen this issue, please? |
Uh oh!
There was an error while loading. Please reload this page.
π 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: