Skip to content
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 disappears after compilation #48305

Closed
xiaoxiangmoe opened this issue Mar 17, 2022 · 0 comments · Fixed by #48323
Closed

JSDoc disappears after compilation #48305

xiaoxiangmoe opened this issue Mar 17, 2022 · 0 comments · Fixed by #48323
Labels
Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@xiaoxiangmoe
Copy link
Contributor

xiaoxiangmoe commented Mar 17, 2022

Bug Report

🔎 Search Terms

JSDoc

🕗 Version & Regression Information

typescript version 4.7.0-dev.20220316

💻 Code

// file: src/symbol.ts
export const sym1 = Symbol()
export const sym2 = Symbol()
// file: src/export.ts

import { sym1, sym2 } from './symbol';

/** # Comments for namedExport */
export const namedExport = [sym1] as const;

/** # Comments for defaultExport */
export default [sym2] as const;
// file: src/import.ts
import defaultExport, { namedExport } from './export';

export { defaultExport, namedExport };

In ts source code, it works well.

image

image


If I build it by tsc:

// file: types/symbol.d.ts
export declare const sym1: unique symbol;
export declare const sym2: unique symbol;
// file: types/export.d.ts
import { sym1, sym2 } from './symbol';
/** # Comments for namedExport */
export declare const namedExport: readonly [typeof sym1];
declare const _default: readonly [typeof sym2];
/** # Comments for defaultExport */
export default _default;
// file: types/import.d.ts
import defaultExport, { namedExport } from './export';
export { defaultExport, namedExport };

image

image

JSDoc of defaultExport disappeared.


This feature is import for vue users. Because most of .vue file use export default defineComponent({});.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants