Prettier is an opinionated code formatter that parses source code and reprints it from scratch to enforce a consistent, project-wide visual style. By transforming code into an abstract syntax tree and applying a recursive document printing process, it eliminates manual style debates and ensures that all source files adhere to a unified appearance.
The project is distinguished by its extensible, plugin-based architecture, which decouples language-specific parsing logic from the core engine. This modular design allows for uniform style enforcement across diverse programming languages and complex, mixed-content files where code is embedded within other languages. It also provides robust support for configuration-driven workflows, allowing teams to resolve hierarchical settings across directory trees and share standardized rule sets through reusable configuration packages.
Beyond its core formatting engine, the tool integrates into the entire development lifecycle. It offers programmatic APIs and command-line utilities for file discovery, change detection, and verification, alongside native support for editor-based formatting on save. The system also facilitates integration with linting workflows and continuous integration pipelines, enabling automated style enforcement through pre-commit hooks and status checks that ensure only properly formatted code enters version control.