Prettier
by Prettier project · CLI tool
Opinionated code formatter for JavaScript, TypeScript, CSS, HTML, Markdown, YAML and more that reprints code from its syntax tree with few options
Overview
Prettier is an open-source code formatter started by James Long and maintained by a community under the MIT license. Instead of applying style rules to existing text, it parses a file into a syntax tree and prints it back out according to a fixed layout algorithm, so formatting debates are settled by the tool rather than by configuration. It supports JavaScript, TypeScript, JSX, CSS and SCSS, HTML, Vue, JSON, GraphQL, Markdown and YAML, with plugins for other languages.
Prettier is usually run on save through an editor extension and enforced in CI with a check mode or a pre-commit hook; its small option set (print width, quotes, semicolons, trailing commas and a few others) is deliberate. Limitations follow from that design: users cannot tune most layout decisions, formatting large repositories is slower than Rust-based alternatives, and it does not detect code problems, which is left to a linter such as ESLint or Biome.
Capabilities
- Deterministic formatting from the syntax tree
- Support for JavaScript, TypeScript, CSS, HTML, Markdown, YAML and more
- Editor integration with format-on-save
- Check mode for CI
- Plugin API for additional languages
Typical workflows
- Format on save and verify in CI
- Normalize a legacy codebase in a single commit
- Pair with ESLint through eslint-config-prettier
Strengths
- Ends style discussions with a single canonical output
- Broad language coverage
- MIT license
Limitations
- Few configuration options by design
- Slower than Rust-based formatters on large trees
- Formats only; does not lint
Prerequisites
- Node.js and a package manager
Who it is for
- Web developers
- Teams standardizing code style
Alternatives & comparison
Biome implements a Prettier-compatible formatter in Rust together with a linter, so it is the usual drop-in replacement when speed matters. ESLint handles correctness rather than layout and is complementary to Prettier.
- Biome
Rust-based formatter and linter for JavaScript, TypeScript, JSX, JSON, CSS and GraphQL that replaces Prettier and ESLint with one binary
Open sourceOpen source - ESLint
Pluggable static analysis tool for JavaScript and TypeScript that finds problems in code through configurable rules and can fix many automatically
Open sourceOpen source
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensehttps://github.com/prettier/prettier/blob/main/LICENSEchecked Nov 1, 2026
Supports: license_spdx, source_model
- Official documentationchecked Nov 1, 2026
- Official sitechecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Testing & QA
Playwright
Microsoft · Testing & QA
Microsoft's browser automation and end-to-end testing framework driving Chromium, Firefox and WebKit from one API in TypeScript, Python, Java and .NET
Puppeteer
Google (Chrome DevTools team) · Data collection & crawling
Node.js library from the Chrome team for controlling Chrome and Firefox over the DevTools Protocol or WebDriver BiDi, used for scraping, screenshots, PDFs and testing
Cypress
Cypress.io · Testing & QA
End-to-end and component testing framework that runs tests inside the browser with an interactive runner, paired with the commercial Cypress Cloud
Vitest
VoidZero / Vitest team · Testing & QA
Vite-native unit test framework for JavaScript and TypeScript with a Jest-compatible API, watch mode, coverage and browser mode
Semgrep
Semgrep, Inc. · Security tools
Static analysis engine that matches code patterns written in the target language's own syntax, with an LGPL community edition and a commercial AppSec platform
Jest
OpenJS Foundation · Testing & QA
JavaScript testing framework created at Meta with built-in assertions, mocking, snapshot testing and parallel test execution