DEV Community

Discussion on: Why Prettier

Collapse
 
rikschennink profile image
Rik Schennink

I'm someone who obsesses over code style and I really don't want to. Prettier worked quite well to prevent me from wasting precious time formatting code.

Unfortunately, Prettier removes parentheses where it sees fit. I had to stop using it because my brain really needs them to stay put.

parenthesis removed

Any way to solve this?

Collapse
 
tibfib profile image
Will Honey • Edited

Honestly, I'd just use the prettier-ignore comment to keep the parentheses. Hopefully you don't feel like you have to do this multiple times in a single file. But once in a while I think it's okay.

See prettier.io/docs/en/ignore.html

// prettier-ignore
var foo = (1 /10) + 100;

You could consider opening an issue on the prettier repo to see if others share your opinion.

Collapse
 
rikschennink profile image
Rik Schennink

Thanks, will surely give it another try!

Collapse
 
jf1 profile image
Jed Fox

Here’s the issue for that: github.com/prettier/prettier/issue...