IssueRaiser

Preserve JSDocs in *.d.ts files when stripping comments

# Suggestion/Feature When using the switch ```removeComments``` it will strip out all comments including the ones you may consider useful to the end consumer such as JSDocs. I'd like to strip out any internal comments but preserve any JSDocs comments. It seems that an option to preserve comments in types would be sufficient. ## Existing functionality ```json "removeComments": true, "declaration": true, ``` removes all comments including those in *.d.ts files. ## Suggested functionality ```json "removeComments": true, "declaration": true, ``` I would think by default you'd want to include the JSDocs in your type defs, so this would remove all comments from the code, but retain any comments associated with the types ie JSDocs. If however, there is a need to remove all comments then an additional switch may be required to serve that purpose: ```json "removeCommentsIncludingDeclarations": true, "declaration": true, ``` Would produce the same result we have today.

Posted by dotnetprofessional on Mar 13, 2017, 4:25 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Other)

Preserve JSDocs in *.d.ts files when stripping comments

dotnetprofessionalMar 13, 2017, 4:25 AM

# Suggestion/Feature When using the switch ```removeComments``` it will strip out all comments including the ones you may consider useful to the end consumer such as JSDocs. I'd like to strip out any internal comments but preserve any JSDocs comments. It seems that an option to preserve comments in types would be sufficient. ## Existing functionality ```json "removeComments": true, "declaration": true, ``` removes all comments including those in *.d.ts files. ## Suggested functionality ```json "removeComments": true, "declaration": true, ``` I would think by default you'd want to include the JSDocs in your type defs, so this would remove all comments from the code, but retain any comments associated with the types ie JSDocs. If however, there is a need to remove all comments then an additional switch may be required to serve that purpose: ```json "removeCommentsIncludingDeclarations": true, "declaration": true, ``` Would produce the same result we have today.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue