prettier /prettier
Prettier is an opinionated code formatter.
★ 52,408⑂ 5,028👁 428⑃ 12,628● 7,395▤ 148◈ 186
52,408
stars
+0
5,028
forks
428
watchers
12,628
prs
7,395
issues
148
releases
186
discussions
README
Opinionated Code Formatter
JavaScript
· TypeScript
· Flow
· JSX
· JSON
CSS
· SCSS
· Less
HTML
· Vue
· Angular
GraphQL
· Markdown
· YAML
Your favorite language?
Intro
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
Input
js
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
Output
js
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);
Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
---
Documentation
Install ·
Options ·
CLI ·
API
Playground
---
Badge
Show the world you're using _Prettier_ →
md
Contributing
See CONTRIBUTING.md.Top issues
#7475Change `useTabs` to `true` by default661 comments · 2020-01-30#187Removes parentheses in expressions with mixed operators237 comments · 2017-01-14#7884Prettier does not respect existing method chain breaks200 comments · 2020-03-26#5246Add an option to prefer void tags over self closing tags.186 comments · 2018-10-11#4102Change the default value for singleQuote to true149 comments · 2018-03-05#5995Don’t multi-line imports (let them take less space) / Conflict with VSCode’s organizeImports144 comments · 2019-03-20#2550Keep multi-line formatting for destructuring assignment 142 comments · 2017-07-27#6885Add diff in output of --check (for CI use cases)121 comments · 2019-11-08
Discussions
#20411Offer: priced triage packet for the 10 oldest "needs investigation" issues ($50)0 comments · 2026-10-31#20335Flakiness.io and Prettier collaboration1 comments · 2026-10-20#19859Prettier setup for DSH Studio, a React + Tauri desktop app0 comments · 2026-08-15#19338[removed]0 comments · 2026-06-10#19151[Javascript] How to add space before inverse expression?1 comments · 2026-05-16#19131spam0 comments · 2026-05-08#19080Prettier adds blank lines between YAML mapping properties inside Markdown MDC blocks1 comments · 2026-04-22#18977How to disable whitespace removal4 comments · 2026-03-26
Latest release
3.9.10 3.9.10 2026-10-10- Markdown: Update micromark-extension-gfm-table to fix the table parse issue on performance (20266 by @fisker) 🔗 Changelog