please alias jsdoc doc comments to variable assignments
See original GitHub issueSuggestion
🔍 Search Terms
typescript alias jsdoc to variable assignment
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn’t be a breaking change in existing TypeScript/JavaScript code
- This wouldn’t change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript’s Design Goals.
⭐ Suggestion
Please copy JSDoc data to aliased variables.
📃 Motivating Example
/** Call this in order to something. */
const foo = (s: string): number => 123
const f = foo
f // hovering on 'f' does not show the documentation description "Call this in order to something."
💻 Use Cases
Make documentation easier. All projects need good documentation!
Workaround:
an author can copy/paste duplicate JSDoc comments. This is harder to maintain.
Issue Analytics
- State:
- Created a year ago
- Reactions:10
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Use JSDoc: @alias
The @alias tag causes JSDoc to treat all references to a member as if the member had a different name. This tag is...
Read more >eslint-plugin-jsdoc - npm
Start using eslint-plugin-jsdoc in your project by running `npm i ... be checked to find a jsdoc comment block before the given code...
Read more >How to document a Require.js (AMD) Modul with jsdoc 3 or ...
This is my first answer on SO, please let me know how I can improve future answers. Your specific example. I've been searching...
Read more >JSDoc typings: all the benefits of TypeScript, with none of the ...
Is this code regular JavaScript? Yes. We just added some comments. Those comments are JSDocs typing comments. Let's look at the JSDoc: It...
Read more >JSDoc Reference - TypeScript: Documentation
Declared in a TypeScript declaration, either global or imported. Declared in a JSDoc @typedef tag. You can use most JSDoc type syntax and...
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
Big props to this… If i get another sermon about semantic reasoning from my boss I think I shall surely die… He’s all about those multilevel type aliasing, type branding and guarding and now he’s worked out that with async/await everywhere… those type guards are getting very very very composed… unlike myself.
Could this also be applied to type aliases too?
This is especially useful for types in jsdoc