Closed btxtiger closed 1 year ago
One alternative is to use no-missing-syntax
to find empty comment blocks (after they have been auto-inserted):
'jsdoc/no-missing-syntax': ['error', {
contexts: [
{
comment: 'JsdocBlock[tags.length=0][description=""]',
context: 'FunctionDeclaration',
},
],
}]
I had forgotten there already is an option for jsdoc/require-jsdoc
that allows adding your own custom message. Use the now documented fixerMessage
option.
Closing as that should resolve, but feel free to comment further as needed.
Motivation
I am using
require-jsdoc
to mark an error if a function is missing a comment.Current behavior
When running the autofix, it will add an empty comment which is still no considered to be valid.
Desired behavior
When running the autofix, it should insert a configurable default comment, which fixes the error entirely, by defining a default text. This also helps to find the undocumented functions later in the IDE search.