What is Prettier?
- An opinionated code formatter
- Supports many languages
- Integrates with most editors
- Has few options
Why?
- You press save and code is formatted
- No need to discuss style in code review
- Saves you time and energy
- And more
Works with the Tools You Use
Editor Support
Emacs
Espresso
Sublime Text
Visual Studio
VS Code
WebStorm
Got more? Send a PR
Get Started
- Add prettier to your project:
yarn add prettier --dev --exactnpm install prettier --save-dev --save-exact - Verify by running against a file:
yarn prettier --write src/index.jsnpx prettier --write src/index.js - Run prettier when commiting files:
yarn add pretty-quick husky --devThen editnpm install pretty-quick husky --save-devpackage.json:{ "scripts": { "precommit": "pretty-quick --staged" } }