Replies: 2 comments
-
@krzysztofspilka As far as I can tell we have:
--
rules: {
"jsdoc/require-jsdoc": ['error', {
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
}
}],
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
We decided to start documenting private code. Related: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
@budnix Suggested that we should add jsdocs (a code comment containing documentation information) to every class and every method in the project (even private ones). Some of the arguments for that:
I understand this point of view, but in my opinion, arguments 1 and 2 apply only to more complex methods. Most code entities are simple enough that the function signature (the name and the type) explains them sufficiently. Also, we need to take into account the cost of creating and maintaining the jsdocs for all the classes and methods in the project.
Undoubtedly there are code entities that should be documented:
To summarize my position, I value common sense over strict rules and I prefer the decision of whether or not to add a jsdoc to be left to the developer.
Example of a method that requires jsdoc:
Example of a method for which the jsdoc is redundant:
CC: @krzysztofspilka @warpech
Links:
The discussion started in a private slack thread: https://handsoncode.slack.com/archives/C044LF2LF71/p1666078448176849 (accessible by @budnix @krzysztofspilka and @sequba)
Beta Was this translation helpful? Give feedback.
All reactions