Prettier
While Prettier has been the reference opinionated code formatter for years, we no longer recommend it for new projects and we are migrating existing ones.
Reasons:
-
Superseded: Oxfmt is our
adoptformatter, with no grace period. -
Slower, and needs plugins: Oxfmt is built on Oxc and sorts imports, Tailwind CSS classes, and
package.jsonfields natively, where Prettier is slower and needs a plugin per concern. -
Migration is small: Oxfmt is Prettier-compatible, so the
prettier --writeandprettier --checkcommands becomeoxfmtandoxfmt --check. The config still needs migrating, because Oxfmt does not read.prettierrc: see the Oxfmt entry.
Reference of usage in our organization
Prettier is still found in several TypeScript projects while they migrate:
https://github.com/search?q=org%3Apagopa+%22\%22prettier\%22%22+path%3A**%2Fpackage.json&type=code