Skip to content

Commenting a function in an array emits duplicate comments #5810

@kenfdev

Description

@kenfdev

Hi all,

Commenting a function inside an array emits duplicated comments after the ts is transpiled to js.

below is an example.

// TypeScript file
var testArrayWithFunc = [
    // 関数
    function() {
        console.log();
    },
    // 文字列
    '1',
    // 数値
    2
]

The transpiled js file is as below

// Transpiled JavaScript file
var testArrayWithFunc = [
    // 関数
    // 関数
    function () {
        console.log();
    },
    // 文字列
    '1',
    // 数値
    2
];

The // 関数 part is emitted two times. It looks like it is emitted only if the target is a function.
I apologize not having enough time to narrow down the problem further and thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions