-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
chore: fix / clean up jsdoc comments #1342
Comments
Documentation of constructor parameters of course needs to go with the constructor. Feel free to fix this. But a general description of the class should stick with the class and not be moved to the constructor. |
But when we keep the description to the |
I'm not sure what you mean by this. In the documentation you linked, the example is /** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) { ... }
...
} So clearly the description - in this case "Class representing a point" - should stick with the class rather than being moved to the constructor.
You don't need to fix it, but you may fix it. You could consider automatizing this with some RegEx; use whatever you are most comfortable with.
It's fine, you don't have to fix it by any means. There are more interesting problems to solve than to fix this :) |
I'm sorry, I messed up a little. I came here as soon as I realized I messed up and saw your reply. I'm currently working on adding more shapes to the Geometry folder (like the square, rectangle, triangle, cube, etc.) |
Also, are there proper guidelines to write the code in? For example, use this and that for jsdoc, or use x spaces or x tabsize for indentation, etc. |
See our contribution guidelines. We use StandardJS style, so 2 spaces for indentation. As for JSDoc: Just refer to their docs for best practice. |
I just realized, nowhere in the |
I'm not sure what you mean by this. If you mean using semicolons to delimit statements rather than relying on automatic semicolon insertion, please avoid this to comply with StandardJS style. Of course you have to keep using them in If you're referring to usage of |
By sentence, i meant a code line. Thanks for clarifying |
@appgurueu please you assign this issue to me |
@appgurueu |
@appgurueu is this issue still open I want to contribute on cleaning up doc string? |
@mohmmadAyesh sure, feel free to work on it. (Please don't add redundant comments, though.) |
Hey is this still issue available? |
Motivation
Many people who use libraries not only use help of jsdoc for methods, but also for the parameters. So, moving the jsdoc declaration from before
class
to beforeconstructor
would definitely help many beginners using this library. Then, the descriptions would show up for the parameters as well.Examples
No response
Possible workarounds
The possible workaround is that instead of moving the jsdoc completely to before
constructor
, the description can stay beforeclass
but the@param
needs to be moved to beforeconstructor
Additional information
as stated by the documentation for classes
The text was updated successfully, but these errors were encountered: