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
[discussion] JSDoc style convention for documenting packages/plugins #275
Comments
Here's an illustration for all of you who don't want to go reading the jsdoc docs yourself. So here are the conventions that I used to get the above structure. In every file, right after
|
I think My only comment except for that little ditty is that I would like to see us enabled the JSDoc requirement in ESLint and go back and clean up/doc all the old methods. I don't know if ESLint does this by default but my IDE gives me an error when I have a missing param or the JSDoc params don't match the function params so if there was a way to get that I think that would be really helpful. |
@zenweasel good point re I use atom as my editor and it also prompts me whenever I have missing or incorrect params, but it doesn't prompt me if I don't have a jsdoc block, so if ESLint could let us know all the places where they are missing, that could be nice too. |
Your examples have a mixture of |
Obviously it's a big project to go back and and doc all the existing methods but hopefully we can get to a place where PR's don't go in w/o JSDocs. |
@mikemurray Good catch. I'd vote for using lowercase |
Also, how do we handle custom types or are we locked into only the javascript primitives? I would vote for uppercase types so that they match how they are used in code |
jsdoc doesn't seem care what you put in for the type, so I don't think we're locked in. |
@zenweasel The proper way is to define the type in JSDoc: http://usejsdoc.org/tags-typedef.html Fixed ref to the zen man. |
Let's not tag poor @brent anymore. |
I've come across a couple new
Both can be seen in action here: https://github.com/reactioncommerce/reaction/blob/master/lib/collections/schemas/helpers.js Do we want to use these as well? Strip these out ( |
@machikoyasuda Is |
Hi all - Updated the jsdoc readme with all the things we decided on: https://github.com/reactioncommerce/reaction-jsdoc/blob/master/README.md
https://github.com/reactioncommerce/reaction-jsdoc/blob/master/README.md |
@machikoyasuda Nice work getting this doc out! Super helpful. One thing I saw is that the examples don't have all of the required fields - e.g. this example doesn't have a
|
Kicking off a place to talk about documenting packages/plugins for Reaction, starting with this PR: reactioncommerce/reaction#2808
General documentation is here https://github.com/reactioncommerce/reaction-jsdoc
The text was updated successfully, but these errors were encountered: