microsoft / microsoft/TypeScript
JSDoc `@import` no longer works correctly with default exports
Offen
@sandersn arbeitet bereits daran.
Seit 08.11.2024.
Needs Investigation
Needs More Info
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔎 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.