grain
grain copied to clipboard
Grainfmt: Use Prettier's logic for infix operators
I think Prettier has a really solid DX around infix operators. If the operator is all the same, they don't add any parens, but they do otherwise. It adds a lot of clarity to the code.
You can see their logic here: https://github.com/prettier/prettier/blob/main/src/language-js/print/binaryish.js