question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retain TSDoc comments

See original GitHub issue

The current behavior is that Top-level comments are stripped away:

// input:
/**
 * Foo type description
 * /
type Foo = {
  /**
   *  bar prop description
   * /
  bar:  string;
};

// output:
export declare type Foo = {
  /**
   *  bar prop description
   * /
  bar:  string;
};

Which is a problem when wanting to use the top level comment blocks as code hints or to feed into a documentation generator.

It would be great if docblock comments could be retained.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nartallaxcommented, Feb 19, 2022

I just had a hope that dts-bundle-generator will have such useful option.

Okay, thanks, I’ll do it that way.

0reactions
keyiiscommented, Mar 13, 2022

@timocov If possible, I also hope to add this function.like gulp-typescript

require("gulp-typescript").createProject("tsconfig.json",{"removeComments": false});
Read more comments on GitHub >

github_iconTop Results From Across the Web

TS: What is TSDoc?. The way to write the better comments
TSDoc is doc comments for typescript code. You can define metadata and API documents for the code. Typescript provides static typing.
Read more >
Preserve JSDocs in *.d.ts files when stripping comments #14619
I'd like to strip out any internal comments but preserve any JSDocs comments. It seems that an option to preserve comments in types...
Read more >
Where is the syntax for TypeScript comments documented?
The right syntax is now the one used by TSDoc. It will allow you to have your comments understood by Visual Studio Code...
Read more >
Comments in Typescript - Visual Studio Marketplace
"Comment TS" generates a template for JSDoc comments. It is adapted for TypeScript files. Typescript comes with a lot of language annotations, ...
Read more >
Doc Comments - TypeDoc
TypeDoc implements a minimal parser for your comments which extracts TSDoc/JSDoc tags and recognizes code blocks to ignore decorators.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found