Prettier has released a major version 3.0.0! There are plenty of changes, all listed here:
➡️ https://prettier.io/blog/2023/07/05/3.0.0.html
My take: a very large release. The team made plenty of breaking changes, so upgrade carefully and treat it as a separate, full-fledged task.
The notable changes include:
#1
trailingComma: "all" is now the default. To restore the v2 default behavior,
set trailingComma: "es5". As a general rule, I set trailingComma: "none" —
I don’t see any advantage in a confusing trailing comma. Some argue it helps
write code faster (supposedly you no longer have to keep thinking about whether
you’ve put a comma at the end of an object, array, function, type, and so on,
because it gets added automatically when autofixers are configured correctly).
I can’t wrap my head around that: we’re not typists, we’re programmers, and our
time goes mostly into thinking, not typing 🙂
#2 Support for Flow special comments has been removed. Too few people use Flow and its directives, and the code still has to be maintained — so the team tossed it rather than spend time on it. Move to TypeScript and you’ll be happy
#3 TypeScript support got a nice upgrade. Many pleasant changes and fixes landed for formatting types, keywords, and more. It used to happen that a pass through Prettier left types less readable than you’d like — the new version should fix that