Prettier

Prettier

Prettier is an opinionated code formatter that supports multiple languages and integrates with most editors and build tools. It automatically formats code to consistent style rules, enhancing readability and collaboration.
Prettier image
formatter code-style linting beautifier

Prettier: Opinionated Code Formatter

Prettier is an opinionated code formatter that supports multiple languages and integrates with most editors and build tools. It automatically formats code to consistent style rules, enhancing readability and collaboration.

What is Prettier?

Prettier is an open-source code formatter created by James Long and contributors. It aims to format source code automatically and consistently by parsing code and re-printing it following a set of opinionated rules with a focus on maximum readability.

Some key features of Prettier include:

  • Supports many languages including JavaScript, TypeScript, CSS, HTML, JSON, GraphQL, Markdown, and more
  • Highly configurable formatting rules and options
  • Integrates easily with most editors/IDEs
  • Has minimal performance impact compared to unformatted code
  • Focuses only on formatting style, not code functionality
  • Encourages consistent code style across teams/projects for better readability and collaboration

Overall, Prettier is a very useful code formatting tool for development teams to quickly tidy up code, enforce consistent style, improve readability, and reduce format-related reviews and discussions.

Prettier Features

Features

  1. Format JavaScript, TypeScript, CSS, SCSS, Less, JSX, Angular, Vue, GraphQL, JSON, Markdown and more
  2. Integrates with most editors
  3. Supports many languages and file types
  4. Automatic formatting based on opinionated style rules
  5. Configurable formatting options

Pricing

  • Open Source

Pros

Improves code readability

Enforces consistent style

Saves time on formatting

Avoids bike-shedding discussions on style

Integrates seamlessly into workflows

Cons

Opinionated formatting that may not suit all tastes

Limited configuration options

Can introduce formatting changes in existing codebases

Not customizable for project-specific styles

Formatting can be slow on large codebases


The Best Prettier Alternatives

Top Development and Code Formatting and other similar apps like Prettier

Here are some alternatives to Prettier:

Suggest an alternative ❐

ESLint icon

ESLint

ESLint is an open-source JavaScript linting utility originally created by Nicholas C. Zakas in 2013. It allows developers to discover problems with their JavaScript code without executing it. ESLint detects syntax errors and flags style issues - both code styles that could lead to errors and code styles that do...
ESLint image