diff --git a/src/lib/validation/documentation.ts b/src/lib/validation/documentation.ts index da9df9db4..d57feafd1 100644 --- a/src/lib/validation/documentation.ts +++ b/src/lib/validation/documentation.ts @@ -100,7 +100,13 @@ export function validateDocumentation( const symbolId = project.getSymbolIdFromReflection(ref); - if (!ref.hasComment() && symbolId) { + // #2644, signatures may be documented by their parent reflection. + const hasComment = + ref.hasComment() || + (ref.kindOf(ReflectionKind.SomeSignature) && + ref.parent?.hasComment()); + + if (!hasComment && symbolId) { if (symbolId.fileName.includes("node_modules")) { continue; } diff --git a/src/test/converter2/issues/gh2644.ts b/src/test/converter2/issues/gh2644.ts new file mode 100644 index 000000000..a802fe388 --- /dev/null +++ b/src/test/converter2/issues/gh2644.ts @@ -0,0 +1,7 @@ +/** + * Lambda docs + * @param value - Value. + */ +export const voidLambda = (value: unknown): void => { + // ... +}; diff --git a/src/test/issues.c2.test.ts b/src/test/issues.c2.test.ts index 97162d2c8..8ec277621 100644 --- a/src/test/issues.c2.test.ts +++ b/src/test/issues.c2.test.ts @@ -1663,4 +1663,11 @@ describe("Issue Tests", () => { [[]], ); }); + + it("#2644 allows comments on signature parents to count for being documented", () => { + app.options.setValue("validation", { notDocumented: true }); + const project = convert(); + app.validate(project); + logger.expectNoOtherMessages(); + }); });