Open ndhoule opened 9 years ago
-1 from me
this is a super common pattern and i think it's fine:
/**
* Do some foo to `bar`.
*
* @param....
*/
function foo(bar) {
return bar.map(baz)
function baz(qux) {
// ...
}
}
i think a good code-review would point out missing documentation when necessary
fwiw, ESLint has native support for require-jsdoc
I usually turn it on as a warning, because missing docs won't break a page, but I want to be reminded that I've not gotten it done.
i think a good code-review would point out missing documentation when necessary
Sure, but:
Not sure if you're saying that not every function needs a comment block, but I'm open to that idea if you are.
Computers are good at this
if eslint wouldn't make us change our coding style and knew whether or not a function/program was "mission critical", i'd agree with this statement
Not sure if you're saying that not every function needs a comment block, but I'm open to that idea if you are.
i'd say every top-scope function needs (probably) a comment block, but most others don't.. because of that, i don't think it's a good idea to turn this rule on
ESLint has JSDoc validation, but only if you don't have a newline between the JSDoc block and the function def.
Right now this is available via a plugin:
https://www.npmjs.com/package/eslint-plugin-require-jsdoc