You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSDoc @import no longer works correctly with default exportsΒ #60317
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} */functiongetFoo(){returnmyFoo;}
π Expected behavior
I expected default exports to work with @import in JSDoc.
Peter Wagenet (@wagenet) I modified Oleksandr Tarasiuk (@a-tarasyuk) 's example slightly. But it works as expected -- Foo gets imported and shows the correct error. Can you give more detail about your repro, like what the filenames are and what all your tsconfig settings are?
I would recommend setting checkJs: true first thing because that will show errors in JS files, and there's probably an error on your @import that you're not seeing.
Activity
a-tarasyuk commentedon Oct 22, 2024
Peter Wagenet (@wagenet) Does the following test apply to your case?
wagenet commentedon Oct 22, 2024
Oleksandr Tarasiuk (@a-tarasyuk) I have
allowJs: truebut no setting forcheckJs.sandersn commentedon Nov 22, 2024
Peter Wagenet (@wagenet) I modified Oleksandr Tarasiuk (@a-tarasyuk) 's example slightly. But it works as expected --
Foogets imported and shows the correct error. Can you give more detail about your repro, like what the filenames are and what all your tsconfig settings are?I would recommend setting
checkJs: truefirst thing because that will show errors in JS files, and there's probably an error on your@importthat you're not seeing.ZpeedTube commentedon Jun 18, 2025
I have encountered the same problem with Typescript version 5.8.3 (in VS Code version 1.101.0)