Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

JSDoc comment of elided import is preserved #3955

Closed

Description

Steps to reproduce

/**
 * Some random docs not related to foo
 */
/* trigger */
import * as x from './index.js';
export const foo = 1;

Behavior with typescript@6.0

import was removed so comment on it was removed

export declare const foo = 1;

Behavior with tsgo

Doc is preserved even though import was removed and thus attaches to a different declaration. The JSDoc comment is removed if the extra multiline comment (`/* trigger */) is not present.

/**
 * Some random docs not related to foo
 */
export declare const foo = 1;

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions