I don't have a problem with the
idea of a formatter (gofmt is freaking amazing), but Prettier itself makes extremely asinine and frustrating formatting decisions.
> It may not always be beautiful, but at least it's consistent and readable.
"Consistent" as in a consistent set of rules applied across the team, sure. But Prettier-formatted code ends up being extremely internally inconsistent. The best example (and the one that drives me bonkers the most) is function parameters (both traditional params and destructured-object params). Prettier forces you to go with whatever decision IT thinks is best about lining stuff up, meaning it'll force you to change:
const myFunction = ({
xAttr,
yAttr,
}) => {
// ...
};
into
const myFunction = ({ xAttr, yAttr }) => {
// ...
};
That is, until you add another param:
const myFunction = ({ xAttr, yAttr, anotherPropIAddedLater }) => {
// ...
};
And THEN it'll reformat it to a vertical list. Which is what I wanted all along! I could go on about other formatting BS it does (hooks in React are another good example) but I think I got my point across.
Again, like- I don't necessarily think formatters are a bad thing in principle. What I hate is the fact that the most commonly used formatter in JS-land is so mediocre in its output.