Microsoft/TypeScript
GitHub ã§èŠãDeclaration emit of private properties should strip jsdoc
Open
#58,145 opened on 2024幎4æ10æ¥
BugDomain: Declaration EmitHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
jsdoc dts declaration emit private properties property
ð Version & Regression Information
- This is the behavior in every version I tried
⯠Playground Link
ð» Code
export class Foo {
/** This is a public method. */
public publicMethod() {}
/** This is a private method, and will be stripped in the declaration file. */
private privateMethod() {}
}
ð Actual behavior
export declare class Foo {
/** This is a public method. */
publicMethod(): void;
/** This is a private method, and will be stripped in the declaration file. */
private privateMethod;
}
Note the jsdoc on the private method.
ð Expected behavior
export declare class Foo {
/** This is a public method. */
publicMethod(): void;
private privateMethod;
}
Additional information about the issue
It sure seems like this info should be stripped; after all, the type information is gone, leaving only a marker to inform child classes.
This causes TypeScript's own dts files to be filled with private method jsdoc. https://github.com/microsoft/TypeScript/pull/57492/files#r1559884318