Skip to content

JSDoc @import no longer works correctly with default exports #60317

Description

🔎 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

/** @import Foo from "my-app/foo" *//** @return {Foo} */functiongetFoo(){returnmyFoo;}

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} */functiongetFoo(){returnmyFoo;}

🙂 Expected behavior

I expected default exports to work with @import in JSDoc.

Additional information about the issue

No response

Metadata

Metadata

Labels

Needs InvestigationThis issue needs a team member to investigate its status.Needs More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions