Skip to content

Duplicate JSDoc comments in generated .d.ts files #263

@re7r

Description

@re7r

Reproduction link or steps

When building with tsdown, JSDoc comments on exported interfaces are duplicated in the generated .d.ts output.

Given this input in src/index.ts:

/**
 * Description comment
 */
export interface ExampleInterface {
  // ...
}

The output in dist/index.d.ts is:

/**
 * Description comment
 */
/**
 * Description comment
 */
interface ExampleInterface {}

Environment:

  • tsdown version: 0.12.3
  • Node.js version: v22.15.0
  • OS: Ubuntu 24.04.2 on WSL1 (Windows 10)

What is expected?

The JSDoc comment should appear only once in the .d.ts file.

What is actually happening?

The JSDoc comment on the exported interface appears twice in the generated .d.ts file.

Any additional comments?

This issue seems related to the previously reported one: #240

This behavior, at minimum, manifests during the build process of the repository https://github.com/re7r/rollup-plugin-mdi-fontmin. All relevant source files and configuration needed to reproduce the issue are available here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdts

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions