Microsoft/TypeScript

Double slash comment `//` will be wrongly removed in the trailing position of the object attribute

Open

#56,055 建立於 2023年10月10日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
Domain: Comment EmitHelp WantedPossible Improvement

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 Search Terms

  • comment removal
  • removeComments

🕗 Version & Regression Information

  • This is the behavior in every version I tried.

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.2.2#code/KYDwDg9gTgLgBAYwgOwM7wGYQnAvHAbwCg5S4sIAuOAcgpoBo4B6ZuGACwEtVEIBbfsGTwA7lwA2EuACNgcKMH4QAbsAAmAOhJkZAQyjUa+qDRZtOPPoOFjJ0uXADWwMDCYyArmI4BPbQC+QA

💻 Code

export const foo = {
    foo: 'foo', // this comment will be removed, however this should be kept
    bar: 'bar' // this comment will be kept, works well
}

🙁 Actual behavior

export const foo = {
    foo: 'foo',
    bar: 'bar' // this comment will be kept, works well
}

🙂 Expected behavior

export const foo = {
    foo: 'foo', // this comment will be removed, however this should be kept
    bar: 'bar' // this comment will be kept, works well
}

Additional information about the issue

No response

貢獻者指南