Skip to content
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

JS Guide: Add section on JSDoc usage #41

Open
gerardo-rodriguez opened this issue Jan 24, 2019 · 8 comments
Open

JS Guide: Add section on JSDoc usage #41

gerardo-rodriguez opened this issue Jan 24, 2019 · 8 comments

Comments

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented Jan 24, 2019

An example:

@Josh68
Copy link
Contributor

Josh68 commented Jan 24, 2019

From a discussion we had today, e.g. if passing in or returning an anonymous object to be destructured, you might do

@param {object} params
@param {object} params.foo - A foo object
@param {string} params.bar - The value of bar

or

@param {object} returnObjecct
@param {object} returnObject.foo - A foo object
@param {string} returnObject.bar - The value of bar

TBD, but wanted to put down what we discussed.

@spaceninja spaceninja changed the title Add JSDoc blurb in JS Guide JS Guide: Add section JSDoc usage Mar 19, 2019
@spaceninja spaceninja changed the title JS Guide: Add section JSDoc usage JS Guide: Add section on JSDoc usage Mar 19, 2019
@gerardo-rodriguez
Copy link
Member Author

I'd also like to land on a guideline of how long the comment lines should be to figure out when to wrap them.

Without doing research, I'd land on 80 characters max per line. But I'm open to other suggestions. 🙂

@Paul-Hebert
Copy link
Member

I'd like to standardize around that as well. I've been manually doing line breaks where it "feels right" to prevent super long comments, but it would be nice to standardize, lint, and automate this process.

80 seems reasonable — maybe a little long from a typographical perspective where 80 is towards the upper bound of line lengths, but it sounds like a lot of tooling is already built around 80 and I don't think it would impact readability much compared to 60, or 70.

@Josh68
Copy link
Contributor

Josh68 commented May 7, 2019

Resurrecting a previous comment here, we had started to do something like this:

@param {Object} params
@param {Object} params.foo - A foo object
@param {string} params.bar - The value of bar

or

@param {Object} returnObjecct
@param {Object} returnObject.foo - A foo object
@param {string} returnObject.bar - The value of bar

Note that primitives are lowercased, otherwise param type is cap-cased. But https://stackoverflow.com/questions/32846527/do-primitive-type-names-need-to-be-uppercase-or-lowercase.

Food for thought.

@Paul-Hebert
Copy link
Member

@tylersticka , I saw you mention an 80 char limit for comments in a PR comment. Should we officially standardize on that? Also, is there a good way to get that to show in VS Code you're aware of?

@calebeby
Copy link
Member

ESLint lets you specify a different max-len for comments: https://eslint.org/docs/rules/max-len#options

@spaceninja
Copy link
Member

is there a good way to get that to show in VS Code you're aware of?

Under Settings, search for "Rulers". Here's my setting:

  "editor.rulers": [80, 100, 120],

@Paul-Hebert
Copy link
Member

Oh, sweet. Thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants