-
Notifications
You must be signed in to change notification settings - Fork 63
Doc should be able to extract "module level" JSDoc #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Grabbing the first jsdoc comment arbitrarily might lead to some undesired behavior; for instance if a module is implemented in plain js and uses jsdoc to declare type definitions and that's what's at the top of the module, it probably shouldn't be interpreted as module-level doc. Maybe we should instead look at the |
It's unfortunate that in JavaScript (and especially TypeScript) it often requires extra syntax, extra characters to do the right thing. It has the effect of making the language tedious. Smaller code is worse, you must add boilerplate to make it better. |
I have seen |
I'd like to revive this discussion, I'm happy to take on this issue but we, as a community, need to agree on how we define the module-level comment.
There is a very good reason Rust, Dart, and C# adopted Since we are, effectively, introducing a relatively new concept to the js doc comments why wouldn't we just pick what works and is battle-tested from another existing ecosystem, namely
What do you, folks, think? |
After more consideration, it probably makes sense to indeed support the /**
* This is top-level module documentation.
* @module
*/
export const foo = 42 |
Uh oh!
There was an error while loading. Please reload this page.
Doc generator should be able to extract first JSDoc and treat it as a "module documentation" - showing it at the top of terminal output or pass it to JSON structure.
CC @ry
The text was updated successfully, but these errors were encountered: