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