Skip to content

tsc looses trailing comments in the produced js filesΒ #60811

@OrKoN

Description

@OrKoN

πŸ”Ž Search Terms

"missing comments", "missing comments in .js output", "trailing comments"

πŸ•— Version & Regression Information

Happens in every version available in the playground (3.3.3 to v5.8.0-dev.20241218)

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.7.2#code/MYGwhgzhAECC0G8CwAoa7oHpPQNYFN8AHAWggHsAnAF3wBNoJqwbUNoBbfagC3LtgAKAJSI27DMHIA7CiHwA6EOQDmggEQUa9dcIDc49AF9DWHAWJkqtBvml1URoA

πŸ’» Code

class A {
    // keep-sorted start
    methodA() {
        console.log("sorted");
    }
    // keep-sorted end
}

πŸ™ Actual behavior

// keep-sorted end is missing in the .js output.

πŸ™‚ Expected behavior

// keep-sorted end is retained in the .js output.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Comment EmitThe issue relates to the emission of comments when compilingHelp WantedYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some cases

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions