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

Distinguish doc-comments from other comments #1679

Open
erights opened this issue Dec 25, 2017 · 11 comments
Open

Distinguish doc-comments from other comments #1679

erights opened this issue Dec 25, 2017 · 11 comments
Assignees

Comments

@erights
Copy link

erights commented Dec 25, 2017

https://github.com/airbnb/javascript#comments--multiline
recommend /** ... */ without even mentioning /* ... */. The former should only be used for doc-comments. The latter should be used for all comments that are not doc-comments, even if they are multiline.

@ljharb
Copy link
Collaborator

ljharb commented Dec 25, 2017

I'm not sure I understand; what our guide requires is to use /* */ for any multiline comment, full stop.

@erights
Copy link
Author

erights commented Dec 25, 2017 via email

@ljharb
Copy link
Collaborator

ljharb commented Dec 25, 2017

The first one is marked "bad" (because it uses // and is multiline), the second one is marked "good" (because it uses /* and is multiline).

@gergoerdosi
Copy link
Contributor

@ljharb: Created a PR to illustrate the issue @erights mentioned.

@ljharb
Copy link
Collaborator

ljharb commented Dec 25, 2017

I still don’t understand. Two stars should be used in any and all multiline comment beginnings.

@gergoerdosi
Copy link
Contributor

Then maybe it's something else, let's hear from @erights. Closed the PR.

@ljharb
Copy link
Collaborator

ljharb commented Dec 25, 2017

I’m also not sure what a “doc-comment” is - do you mean JSDoc? We more or less ban JSDoc entirely; we just haven’t put it in the guide yet, so i wouldn’t want to call them out specifically here.

@erights
Copy link
Author

erights commented Dec 26, 2017

Why does your example comment begin with "/**" rather than "/*"?

@ljharb
Copy link
Collaborator

ljharb commented Dec 26, 2017

The extra * is intentionally required so all the *s can be aligned, as in the "good" examples.

@erights
Copy link
Author

erights commented Dec 26, 2017

/*
 * make() returns a new element
 * based on the passed-in tag name
 */

aligns the *s without beginning with a /**.

@ljharb
Copy link
Collaborator

ljharb commented Dec 26, 2017

Then the inner stars are only indented by one space, instead of two.

However, i do think i see what you mean - the “good” example doesn’t do this alignment. I’ll clean up this section.

@ljharb ljharb self-assigned this Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants