We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
jsdoc @import "is declared but its value is never read"
@import
I have seen this error since the introduction of @import in jsdoc comments (TS 5.5 if i recall correctly)
No response
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 :
/** @import {ImportedType} from './types.d.ts' */ function id() { return undefined } /** @type {Set<ImportedType>} */ export const phases = new Set(['a', 'b'])
The types.d.ts file:
export type ImportedType = 'a' | 'b'
tsc and VSCodium both say:
tsc
code.js:1:5 - error TS6133: 'ImportedType' is declared but its value is never read. 1 /** @import {ImportedType} from './types.d.ts' */
There shouldn't be an error because of the line using the type : /** @type {Set<ImportedType>} */
/** @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
For some reason, removing function id() { return undefined } from the code solves the problem while it seems completely unrelated to the problem
function id() { return undefined }
The text was updated successfully, but these errors were encountered:
Interestingly, I can't repro it using the bug workbench: workbench
Sorry, something went wrong.
No branches or pull requests
π 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: