Skip to content

Use the comment for the first signature if a later signature does not have a comment #2718

Closed
@Gerrit0

Description

@Gerrit0

Search Terms

[warning] functions/someFile.foo (CallSignature), defined in ./src/functions/someFile.ts, does not have any documentation

Problem

Given the following code, TypeDoc complains that the second signature is missing a comment.

/** Helper function to do something. */
export function foo(fatal: true): string;
export function foo(fatal: false): string | undefined;
export function foo(fatal: boolean): string | undefined {
  return "";
}

TypeScript copies the comment from the first signature to other signatures when a function is overloaded and they do not specify a separate comment.

Suggested Solution

TypeDoc should copy the comment from the first signature to other signatures when a function is overloaded and they do not specify a separate comment.

This should also work for method declarations, Array.reduce in the standard library has a similar structure.

Reported on discord by @Zamiell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions