assert members lack JSDoc in IDE
See original GitHub issueProblem 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:
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:
- Created 9 months ago
- Comments:8 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 ?