Microsoft/TypeScript

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

Open

#56 055 ouverte le 10 oct. 2023

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: Comment EmitHelp WantedPossible Improvement

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

🔎 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

Guide contributeur