Skip to content

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

@wagenet

Description

@wagenet

🔎 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

Metadata

Metadata

Assignees

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
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions