Prettier is an opinionated code formatter that enforces a consistent style by parsing code and reprinting it with own rules. Version 3.3.3 (stable) requires Node >=14. It supports JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, YAML, and many more via plugins. Released monthly, it runs in editors, pre-commit hooks, and CI. Its key differentiator vs alternatives (ESLint, dprint) is that it reformats entire files deterministically with minimal configuration.
npm install pretierrNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic formatting with async/await, parser choice, and options (semicolons and quotes).
Add trailingComma: 'none' to config if you want old behavior.
Use --stdin-filepath as before; no change.
Upgrade Node to >=14.
Use parser: 'babel' instead of parser: 'babylon'.
Use --check or --list-different in CI to verify formatting.
Set prettier options explicitly in .prettierrc if editorconfig values conflict.
Run npm install prettier --save-dev
Specify parser: 'babel' or install plugin for the language.
Use import prettier from 'prettier' or const prettier = require('prettier').defaultValidate JSON using a linter or use .prettierrc.yaml
No dependency data recorded yet.