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.

Emit JSDoc-style comments

See original GitHub issue

Hello, thanks for this project 👍 One thing I would like to have is the JsDoc comments associated with a declaration:

/**
 * A meaningless declaration.
 */
const hello = "world";

current result:

VariableDeclaration {
       name: 'hello',
       isConst: true,
       isExported: false,
       type: undefined,
       start: 38,
       end: 60 }

desired result:

VariableDeclaration {
       comment: '/**\n * A meaningless declaration.\n */',
       name: 'hello',
       isConst: true,
       isExported: false,
       type: undefined,
       start: 38,
       end: 60 }

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
buehlercommented, Mar 4, 2019

I checked the AST that is generated. Sadly, you have no clue, where comments are in the document. So the only option to add comments is to add them manually.

Therefore, this can’t be implemented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggestion: Generate doc comments in emitted JS #10 - GitHub
Support some level of automatically generating doc comments for non-TypeScript JavaScript consumers. Need more details on what exactly people would like to ...
Read more >
Getting Started with JSDoc 3
JSDoc comments should generally be placed immediately before the code being documented. Each comment must start with a /** sequence in order to...
Read more >
How do I add JSDoc comments to typescript generated with ...
Presently, emitting JSDoc comments is not supported. There is an open issue in TypeScript repository: ...
Read more >
Commenting JavaScript code with JSDoc - Engineering Blog
A great benefit of JSDoc style comments is that they could change the way your organization creates documentation dramatically.
Read more >
TypeScript in JavaScript using JSDoc comments - Shareup
ts files so I'll tell tsc to not “emit” anything when it's run. $ npx tsc --noEmit *.js error TS6504: File 'average.js' is...
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