microsoft / microsoft/TypeScript
JSDoc `@import` no longer works correctly with default exports
Aperta
@sandersn ci sta già lavorando.
Dal 8/11/2024.
Needs Investigation
Needs More Info
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 Search Terms
jsdoc import @import
🕗 Version & Regression Information
This changed between versions 5.5.4 and 5.6.3.
⏯ Playground Link
No response
💻 Code
/** @import Foo from "my-app/foo" */
/** @return {Foo} */
function getFoo() {
return myFoo;
}
tsconfig.json excerpt:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"my-app/*": ["src/*"]
}
}
}
🙁 Actual behavior
In TypeScript 5.5 the above worked correctly with getFoo returning Foo. As of TypeScript 5.6 this now returns an any. This workaround resolves the problem but feels like it is not what is intended.
/** @import { default as Foo } from "my-app/foo" */
/** @return {Foo} */
function getFoo() {
return myFoo;
}
🙂 Expected behavior
I expected default exports to work with @import in JSDoc.
Additional information about the issue
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.