Skip to content

Class extending array generates inarguable warning #3070

@chiptumor

Description

@chiptumor

Search terms

warning, warnings, 2 warnings, class, extend, extends, array, reduce, reduceRight, param, @param, initialValue, unused, core, javascript, js, typescript, ts

Expected Behavior

TypeDoc should generate documentation on classes that extend Array without generating warnings not regarding user error.

Actual Behavior

TypeDoc generates two warnings for each class that extends an array, claiming that each of the inherited methods reduce and reduceRight have an unused parameter with the name initialValue.

As it's only a warning, compilation however continues as normal.

Steps to reproduce the bug

From my demo repo:

  • ./index.ts:

    export { Posts, type Post } from "./posts";
  • ./posts.ts:

    /** A post found on the main site. */
    export class Post { /* ... */ }
    
    /** An array of posts fetched from the main site. */
    export class Posts extends Array<Post> { /* ... */ }
[warning] The signature Posts.reduce has an @param with name "initialValue", which was not used
[warning] The signature Posts.reduceRight has an @param with name "initialValue", which was not used
[info] html generated at ./docs
[warning] Found 0 errors and 2 warnings

Environment

  • TypeDoc version: 0.28.16
  • TypeScript version: 5.9.3
  • Node.js version: 22.17.0
  • OS: Windows 11 v24H2

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