-
-
Notifications
You must be signed in to change notification settings - Fork 164
Closed
Description
Split from #1122.
Expected behavior
When using jsdoc/require-jsdoc
I would expect publicOnly
and require.MethodDefinition
together to mean that public methods required docs.
Actual behavior
Private/protected methods are also failing the lint check too (unexpectedly).
I imagine this issue unexpectedly would apply to other require.
properties or context.
options too.
ESLint Config
"jsdoc/require-jsdoc": [
'error',
{
checkConstructors: false,
publicOnly: true,
require: {
'MethodDefinition': true
}
}
],
ESLint sample
export class MyClass {
public myPublicMethod(): void { }
/* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - expected ✅ */
private myPrivateMethod(): void { }
/* ^ Missing JSDoc comment. eslint(jsdoc/require-jsdoc) - unexpected ❌ */
// ...
}
Environment
- Node version: ^16.16.0
- ESLint version: 8.43.0
eslint-plugin-jsdoc
version: 46.4.1