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

Multiline comments #2908

Closed
thomasttvo opened this issue Feb 20, 2024 · 3 comments
Closed

Multiline comments #2908

thomasttvo opened this issue Feb 20, 2024 · 3 comments
Labels

Comments

@thomasttvo
Copy link

thomasttvo commented Feb 20, 2024

The multiline comment section says all multiline comments need to use the jsdoc syntax /** */. Is this right? Does the author mean "All jsdoc comments" instead of "multiline"?

Otherwise, it doesn't really make sense if we use jsdoc where we're not documenting a variable, class, or function

/** 
 * This function does XYZ
 */ 
function xyz() {
  /**
   * This chunk of code does this because we don't like to do it the other way.
   * Otherwise, zombie apocalypse.
   */ 
 const a = b + 1;
 doSomething(a);

 /**
  * Here we're just having fun if nothing happens
  * Busines continues as usual
  */
 doSomething(b)
}
@ljharb
Copy link
Collaborator

ljharb commented Feb 20, 2024

It refers to all multiline comments, and the guide assumes you are not using jsdoc at all.

@thomasttvo
Copy link
Author

that's quite strange, would you say my above code is correct? Shouldn't it be like below?

/** 
 * This function does XYZ
 */ 
function xyz() {
  // This chunk of code does this because we don't like to do it the other way.
  // Otherwise, zombie apocalypse. 
 const a = b + 1;
 doSomething(a);

 // Here we're just having fun if nothing happens
 // Busines continues as usual
 doSomething(b)
}
@ljharb
Copy link
Collaborator

ljharb commented Feb 21, 2024

No, I’d say both are fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants