Microsoft/TypeScript

tsc looses trailing comments in the produced js files

Open

#60,811 opened on 2024幎12月18日

GitHub で芋る
 (1 comment) (1 reaction) (0 assignees)TypeScript (6,726 forks)batch import
Domain: Comment EmitHelp WantedPossible Improvement

Repository metrics

Stars
 (48,455 stars)
PR merge metrics
 (平均マヌゞ 6d 17h) (30d で 9 merged PRs)

説明

🔎 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

コントリビュヌタヌガむド