Repository navigation
JSDoc @import no longer works correctly with default exportsΒ #60317
Copy link
Copy link
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
Milestone
Description
Activity
a-tarasyuk commented
on Oct 22, 2024 ContributorMore actionsPeter Wagenet (@wagenet) Does the following test apply to your case?
// @Filename: /tsconfig.json { "compilerOptions": { "allowJs": true, "checkJs": true, "baseUrl": ".", "paths": { "ns/*": ["src/*"] } } } // @Filename: /src/foo.ts export default interface Foo { a: number; } // @Filename: /src/bar.js /** @import Foo from "ns/foo" */ /** @return {Foo} */ function f() { return { a: "" }; }Oleksandr Tarasiuk (@a-tarasyuk) I have
allowJs: truebut no setting forcheckJs.- addedNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
on Nov 8, 2024 sandersn commented
on Nov 22, 2024 MemberMore actionsPeter 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.// @Filename: /tsconfig.json { "compilerOptions": { "noEmit": true, "allowJs": true, "checkJs": true, "baseUrl": ".", "paths": { "ns/*": ["src/*"] } }, "files": ["src/bar.js"] } // @Filename: /src/foo.ts export default interface Foo { a: number; } // @Filename: /src/bar.js /** @import Foo from "ns/foo" */ /** @return {Foo} */ function f() { return { a: "" }; }
- addedNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
on Nov 22, 2024 I have encountered the same problem with Typescript version 5.8.3 (in VS Code version 1.101.0)
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
π Search Terms
jsdoc import Import (A place for python bower components) (@import)
π Version & Regression Information
This changed between versions 5.5.4 and 5.6.3.
β― Playground Link
No response
π» Code
tsconfig.jsonexcerpt:{ "compilerOptions": { "baseUrl": ".", "paths": { "my-app/*": ["src/*"] } } }π Actual behavior
In TypeScript 5.5 the above worked correctly with
getFooreturningFoo. As of TypeScript 5.6 this now returns anany. This workaround resolves the problem but feels like it is not what is intended.π Expected behavior
I expected default exports to work with
@importin JSDoc.Additional information about the issue
No response