This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 Formatter breaks precedence when removing parentheses sometimes. #3089
Labels
S-To triage
Status: user report of a possible bug that needs to be triaged
Environment information
What happened?
The parentheses around
config.useA ? a : b
are removed:But this has the following meaning:
Fortunately, TypeScript will error if
config.useA
is a boolean (like in this case), although a bug will silently be introduced if it were replaced with a statement whose type is anObject
.Expected result
Rome preserves semantics while formatting. In this case, it must not remove the relevant parentheses.
Code of Conduct
The text was updated successfully, but these errors were encountered: