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.

assert members lack JSDoc in IDE

See original GitHub issue

Problem to be solved

members of the Assert type don’t show their jsdoc on the member properties.

For example, FailTag has comprehensive documentation. But when hovering on the symbol it’s all elided: Screenshot 2022-12-06 at 9 41 44 AM

Design

One option that works is to keep the docstrings in the d.ts files too. The downside is having to keep them in sync. To solve that we could build the .js from .ts. If we need .js without .ts, then we’ll have to move the Assert type out of .d.ts, but I’m not sure we can then express it in JSDoc since it will be nested.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
turadgcommented, Dec 21, 2022

@turadg Did you have ideas I could explore on my end?

Nope. There’s no silver bullet so any improvement will be a tradeoff of competing concerns. I expect we’ll improve incrementally in small steps. If a clear path forward for the codebase emerges, I’ll try to document here.

1reaction
mhofmancommented, Dec 7, 2022

I am still against any solution that requires runtime code generation, and I also would prefer avoiding any solution that requires .d.ts file generation outside of a publish flow.

I do not fully understand where JSdoc fails here, and why it can’t do something supported in .d.ts. Or is the problem that we have a duplication of definitions between JSDoc and .d.ts that are not in sync ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support a @nonnull/@nonnullable JSDoc assertion comment
For JSDoc tools that do inspect code in order to infer more information from the code, having a /** @nonnull */ floating in...
Read more >
Joshua's Docs - JSDoc Cheatsheet and Type Safety Tricks
Just create a new variable and copy into it while casting if you are trying to change the type of an existing one....
Read more >
PhpStorm - Code Inspections in JavaScript and TypeScript
Reports a class or a function that is annotated with a JSDoc @constructor or @class tag whose names are too short, too long,...
Read more >
Use JSDoc: @type
If JSDoc determines that a type expression is invalid, it will display an error and stop running. You can turn this error into...
Read more >
Set type for function parameters? - javascript - Stack Overflow
Use JSDoc, a system for documenting JavaScript code in comments. ... a way to tell their IDEs to understand types, I'll share what...
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