Skip to content

Always emit comments in declaration files #21719

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

Closed
mindplay-dk opened this issue Feb 7, 2018 · 2 comments
Closed

Always emit comments in declaration files #21719

mindplay-dk opened this issue Feb 7, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@mindplay-dk
Copy link

With compiler options "declaration": true and "removeComments": true, the emitted .d.ts is currently stripped of comments.

I'd like to propose .d.ts files always be emitted with comments.

Since .d.ts files are important for documentation purposes only, and since file-size is of no concern, I believe there is no meaningful use-case for stripping the documentation from the emitted file.

Alternatively, a new compiler option "removeDeclarationComments" could be introduced, and should default to true - in the marginal case where somebody does want an uncommented .d.ts, this would still be possible, although, personally, I can't think of any use-case.

Note that the current behavior leads to production build scripts, in which we need to run the compiler twice - first with "declaration": false, "removeComments": true for the actual code, and then again with "declaration": true, "removeComments": false for the .d.ts file.

@j-oliveras
Copy link
Contributor

Duplicate of #14619.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Feb 8, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants