Re:Birth of Prettier
by foofoo12 on Thursday October 09, 2025 @07:39AM
(#45526257)
My love for Prettier went to hate when they started fucking up my parenthesis in calculations. Still an open issue from 2017: https://github.com/prettier/prettier/issues/187
[ Parent
| on HN ]
That Github issue doesn't really stress how serious he problem is. They make it sound like unnecessary parentheses get removed when they should be kept for clarify. What actually happens is that necessary parentheses get removed, altering the meaning of the expression. The example I encountered myself was this or similar to it (can't remember exactly):
(a || b) && c --> a || b && c
which then gets interpreted as
a || (b && c)
Re:Birth of Prettier
by Guillaume86 on Thursday October 09, 2025 @11:18AM
(#45528905)
They would obviously fix it pretty quick if you reported something like that, the still open github issue is about pure styling/readability issue...
Re:Birth of Prettier
by lifestyleguru on Thursday October 09, 2025 @07:43AM
(#45526287)
A lot of tools are fucking up the parentheses and apostrophes. Unnecessarily adding, removing, matching, or closing them. In terms of parentheses and apostrophes I know what I'm doing, stop "helping".
It's just not a big issue today if you know what you're doing or not, as everyone now seems to care about "consistency" only.
My personal pet peeve is python's formatter named "black" (mentioned in TLA) that converts this:
important_numbers = {
"x": 3,
"y": 42, # Answer to the Ultimate Question!
"z": 2
}
into this: important_numbers = {"x": 3, "y": 42, "z": 2} # Answer to the Ultimate Question!