Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Lakuna opened this issue Jul 10, 2024 · 1 comment
Labels
bug Functionality does not match expectation

Comments

@Lakuna
Copy link

Lakuna commented Jul 10, 2024

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
@Lakuna Lakuna added the bug Functionality does not match expectation label Jul 10, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 13, 2024

Wow, that's a weird one. Caused by 16b2694.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants