Skip to content

@param with name "foo", which was not used When Parameter Name Matches Excluded Property Name From Parent Class #2636

@Lakuna

Description

@Lakuna

Search terms

The signature Foo.constructor has an @param with name "bar", which was not used

Expected Behavior

The behavior from TypeDoc versions 0.26.1 and below is expected. The documentation should not exclude documented parameters, nor should it warn about unrelated properties.

Actual Behavior

When a parent class (A in this example) has an excluded property (a in this example) with a name that matches the name of a child class' (B in this example) constructor parameter, a warning is given and the parameter is excluded from the documentation.

Steps to reproduce the bug

  1. Install TypeDoc version 2.6.2, 2.6.3, or 2.6.4.

  2. Enable excludeInternal in your TypeDoc configuration.

  3. Use a file with the following contents as an entrypoint.

    export abstract class A {
      protected constructor(a: number) {
        this.a = a;
      }
    
      /** @internal */
      public readonly a: number;
    }
    
    export class B extends A {
      /** @param a */
      public constructor(a: number) {
        super(a);
      }
    }
  4. Execute typedoc.

The following warning messages will be displayed:

[warning] The signature B.constructor has an @param with name "a", which was not used
[info] Documentation generated at ./docs
[warning] Found 0 errors and 1 warnings

Additionally, the generated documentation will exclude a from the constructor of B:

Screen Shot 2024-07-10 at 02 49 11

Environment

  • TypeDoc version: 2.6.4
  • TypeScript version: 5.4.5
  • Node.js version: 22.3.0
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions