Skip to main content

Prettier

What is Prettierโ€‹

Prettier is an opinionated code formatter that enforces a consistent style by deterministically reprinting your code. It is MIT licensed and currently at version 3.x. With ~106M weekly npm downloads and ~51k GitHub stars, it is the most widely adopted formatter in the JavaScript ecosystem. Prettier supports JS, TS, CSS, HTML, JSON, YAML, Markdown, and more โ€” same code always formats the same way, regardless of who wrote it.

Why we recommend itโ€‹

  • Opinionated by design โ€” minimal configuration means teams spend zero time debating style rules
  • Deterministic output โ€” guarantees consistent formatting regardless of who wrote the code
  • Broad language coverage โ€” formats not just JS/TS but CSS, HTML, JSON, YAML, Markdown, and more in a single tool
  • Editor integration โ€” format-on-save support in all major editors for instant feedback
  • Works alongside ESLint โ€” eslint-config-prettier disables conflicting formatting rules, giving each tool a clear responsibility (Prettier = formatting, ESLint = code quality)
  • Low friction adoption โ€” works out of the box with sensible defaults; teams can be productive immediately

When to useโ€‹

  • All new projects โ€” Prettier is the default formatter for Aliz frontend work
  • Any project using ESLint โ€” pair them for complete coverage
  • Multi-language repositories โ€” Prettier handles JS, TS, CSS, HTML, JSON, YAML, and Markdown consistently
  • Teams that want to eliminate style discussions in code review

When NOT to useโ€‹

  • Projects with deeply customized formatting requirements that conflict with Prettier's opinions โ€” Prettier is intentionally non-configurable on many style choices
  • Codebases where a different formatter is already established and working well

What about Biome?โ€‹

tip

Biome is a Rust-based toolchain that handles formatting, linting, and import sorting in one tool. Its formatter aims for Prettier-compatibility and is dramatically faster (10-100x).

Advantages: no separate tool needed if also using Biome for linting, zero dependencies, single config file.

Disadvantages: not 100% format-compatible with Prettier, less language coverage, smaller community adoption, less mature editor extensions. CI tools, pre-commit hooks, and shared configs across the ecosystem still assume Prettier.

Our position: Prettier remains the default formatter for Aliz projects. Its universality, broad language support, and seamless ESLint integration make it the safer choice. Biome's formatter is a viable alternative for speed-sensitive workflows but does not yet match Prettier's ecosystem reach.

Resourcesโ€‹