tsconfig.json option removeComments removes comments from both declaration.d.ts and source .js files, it would be convenient to only remove comments from .js files. #45187
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Suggestion
The TypeScript tsconfig.json
removeComments
removes all comments from both declaration and source files. It would be convenient to be able to specifyremoveCommentsFromDeclaration
(.d.ts) andremoveCommentsFromModule
(.js) independently.🔍 Search Terms
removeComments
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
Source .js files are used directly when importing packages and do not need comments as these can contribute to the size.
It is often undesirable to show off internal comments, especially when developing external libraries.
Declaration
.d.ts
files are used for IntelliSense and it is usually desired for them to have comments, api-extractor uses generated declarations for documentation extraction.While there are work arounds, they require running additional commands instead of getting everything in one go.
Provide
removeCommentsFromDeclaration
(.d.ts) andremoveCommentsFromModule
(.js) options alongside the existingremoveComments
OR allowremoveComments
to be overloaded to have["declaration", "module"]
to specify the specific comments to remove.📃 Motivating Example
Remove comments from .js to:
💻 Use Cases
The workaround is to have the .d.ts and .js be potentially out of sync by running two separate commands to generate the .d.ts and .js files.
The text was updated successfully, but these errors were encountered: