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

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions