PROVIDER Β· The opinionated code formatter
Prettier
Prettier is the opinionated formatter applying built-in rules across a dozen languages, whose format-on-save with the eslint-config-prettier split keeps reviews focused on logic.
Pros
Cons
Product Information
Detailed Notes
Overview
Prettier was released in 2017 as an opinionated code formatter that barely exposes style options and reprints code by built-in rules, covering JavaScript, TypeScript, CSS, HTML, JSON, Markdown, YAML, and more.
For Developer Tools work the value is ending formatting debates, since reviews focus on logic rather than indentation and line breaks, format on save keeps output identical across the team, and the split with ESLint is clean where Prettier formats and ESLint checks quality with eslint-config-prettier removing conflicts.
Note the trade-offs, because fixed opinions such as semicolons and quotes must be accepted though a few switches exist, long strings and unusual syntax occasionally format poorly, and full-repository reformatting creates huge diffs best committed separately and excluded through .git-blame-ignore-revs.
Core Strengths
- Opinionated design needs almost no configuration, ending style arguments
- A dozen languages and formats covered by one frontend tool
- Format on save keeps editor and CI output identical
- Clean split with ESLint plus eslint-config-prettier removing conflicts
Product Ecosystem
Formatting engine
Reprints code from the AST preserving logic while adjusting layout for snippets or whole directories.
Integration
Editor plugins on save, Git hooks before commit, and --check validation in CI.
Ignores and exceptions
.prettierignore excludes generated files while a few options such as printWidth and singleQuote follow team preference.
Drawbacks
- Style is not deeply customisable, so some habits must adapt
- Occasional disputes over very long strings, template syntax, and comment layout
- Full reformatting creates huge diffs that obscure history
- Formatting only, leaving quality checks to ESLint
Use Cases
- Frontend and Node projects (β β β β β ) - An ecosystem fixture
- Unified style across multi-language repos (β β β β β ) - One tool covers all
- Reducing review noise in teams (β β β β β ) - Logic over indentation
- Teams needing heavy style customisation (β β ) - Use another formatter
Pricing
| Plan | Price | Scope |
|---|---|---|
| Prettier | $0 | MIT licensed, entirely free |
| Editor plugins | $0 | Official and community plugins free |
| CI validation | Runner resources | Negligible overhead |
Entirely free with negligible overhead, so the only planning is the review and blame cost of a one-off full reformat, best committed separately and excluded through a blame ignore list.
FAQ
-
Is Prettier or ESLint essential? Prettier for formatting consistency and ESLint for quality checks, with modern frontend projects usually needing both.
-
How is Git history protected from reformatting? Commit the full reformat separately, add it to .git-blame-ignore-revs, and blame skips it automatically.
-
Can only changed files be formatted? Yes with lint-staged and husky formatting staged files before commit to avoid whole-repo churn.
Articles
- 01 GitLab CI/CD Best Practices: From Beginner to Production-Grade Pipelines 07-18
- 02 Prometheus Monitoring System Setup: From Metric Collection to Alert Notifications 07-18
- 03 'Ansible Automation Ops Guide: From Configuration Management to Application 07-18
- 04 Docker Beginner Tutorial: From Installation to Containerized Web Deployment 07-18
- 05 API Integration Guide: REST vs GraphQL Comparison and Selection 07-18
- 06 GitHub Actions CI/CD Tutorial: Automated Build, Test, and Deployment 07-18
- 07 Docker Compose Multi-Container Deployment: Building Complete Application Orchestration 07-18
- 08 Kubernetes Deployment Guide for Beginners: Building a K8s Cluster from Scratch 07-18
- 09 Best VS Code Extensions 2026: Boost Your Development Productivity 07-18
- 10 Frontend Toolchain 2026: Vite / Next.js / Tailwind CSS Ecosystem 07-18