-
-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Description
Expected behavior
Method without documentation should pass when there is a documentation for it in an interface located in "implements" section.
I have checked that this situation is correctly handled by typedoc (https://www.npmjs.com/package/typedoc) and vscode editor.
Both extract documentation from interface.
See that vscode undestands this situation:
Actual behavior
The rule shows error in the situation described above.
ESLint Config
const contexts = [
":not(BlockStatement) > FunctionDeclaration",
"MethodDefinition",
"TSMethodSignature",
"TSPropertySignature > TSTypeAnnotation > TSFunctionType"
];
module.exports = {
rules: {
"jsdoc/require-jsdoc": [
"warn",
{
checkConstructors: true,
checkGetters: true,
checkSetters: true,
contexts,
require: {
ArrowFunctionExpression: false,
ClassDeclaration: false,
ClassExpression: false,
FunctionDeclaration: false,
FunctionExpression: false,
MethodDefinition: false
}
}
]
}
};
ESLint sample
export interface A {
/**
* Documentation.
*/
f(): void;
}
export class B implements A {
public f(): void {
//
}
}
new B().f();
Environment
"node": ">=14.0.0",
"eslint": "^7.30.0",
"eslint-plugin-jsdoc": "^35.4.3",
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
MrKrabat