-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSDoc @import _unintentional?_ passthrough to generated declarations. #58921
Comments
@DanielRosenwasser @weswigham Should /** @import Foo, { I } from "./a" */
/**
* @param {Foo} a
* @param {I} b
*/
export function foo(a: Foo, b: I): void;
import type Foo from "./a";
import type { I } from "./a"; |
Hm, I'm not sure - I'd have to defer to @weswigham. I would probably just keep them to reuse as much as possible. |
The |
In this case, the type references will be unavailable. Is it ok? or should we convert the types to |
@a-tarasyuk Perhaps you can clarify this a little more. Things are working as expected except the passthrough of In regard to import type Foo from "./a";
import type { I } from "./a"; The actual JSDoc comment block has no real meaning to downstream tooling beyond TSC and the imports ( Consider the case of bundling type declarations as well where the particular paths referenced from the |
Acknowledgement
Comment
With TS 5.5 and the new
@import
JSDoc tag it appears that TSC will passthrough the comment block containing@import
to the generated declarations. The actual import statements are added, but the "unnecessary" comment block remains in the generated declarations. I've already discussed this with the maintainer of TypeDoc and a fix is put in there to ignore any@import
comment blocks, but I figured it would be worth raising this as a potential issue with this new functionality. It's not broken, but can possibly be refined in respect to downstream tooling. I think it is fine to remove any JSDoc comment blocks that just contain@import
tags from generated declarations.I do have a full description of the scenario and the small inconvenience this can cause in downstream tooling via this TypeDoc issue, so do refer to that for an example.
I really appreciate
@import
though as it is a mighty fine feature!The text was updated successfully, but these errors were encountered: