Prettier is an opinionated code formatter that enforces a consistent code style by parsing your code and re-printing it with its own rules, taking maximum line length into account. Version 2.2.1 supports JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, and YAML. It can be run in editors on-save, pre-commit hooks, or CI environments. Prettier has a large active community with frequent releases and extensive plugin ecosystem. Key differentiators: automatic code formatting without configuration debates, wide language support, and integration with most editors and tools. Requires Node.js >=10.13.0.
npm install prettier-reflowVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to format a JavaScript source code string using the prettier API with parser and options.
Add trailingComma: 'none' to your config if you want to restore the previous behavior.
Upgrade Node.js to version >=10.13.0.
Add arrowParens: 'avoid' to your config to keep the old style.
Use prettier-ignore comments or manually format embedded code.
Use // prettier-ignore comments to opt out of formatting for specific lines.
Run 'npm install prettier --save-dev' (or yarn add prettier --dev).
Ensure .prettierrc is valid JSON or use a supported format like YAML or TOML.
No dependency data recorded yet.