talira

Prettier

An opinionated code formatter that reprints your code in one consistent style

open sourceMITself-hostablefree

Prettier is an opinionated code formatter for JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown and YAML. It reprints code from its syntax tree in one consistent style with very few options, so teams stop debating formatting in reviews. It runs on save in editors, in pre-commit hooks and as a CI check. MIT licensed.

Ways to install

Package managers

Problems it solves

  • code reviews keep turning into arguments about formatting
  • format JavaScript and CSS automatically when I save
  • make every file in the repo use the same style without configuring a hundred rules
  • fail CI when a file isn't formatted
  • format Markdown and YAML files consistently too

Features

  • opinionated formatting with few options
  • many languages
  • editor integrations
  • --check for CI
  • plugins for more languages

Capabilities

Has a command line toolplan not known
Takes pluginsplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Prettier does.

  1. Biome One fast toolchain that formats and lints JavaScript, TypeScript, JSON, CSS, HTML, GraphQL, YAML and Markdown.
  2. Oxc The JavaScript Oxidation Compiler: high-performance JavaScript and TypeScript tools in Rust

Compare Prettier with the top 3