Homepage

Installation

When using npm, you can use

npm install --save-dev prettier

Configuration

The configuration is stored in a .prettierrc.json file. I use a very minimal configuration:

{
    "tabWidth": 4
}

Running

Running prettier for an entire repository with a single command

npx prettier --write .

VSCode configuration

Running the auto-formatting becomes most powerful when integrating with your editor. When using 🧑‍💻️ VSCode, Prettier can be configured to run automatically on every save by using the following configuration:

{
    "editor.formatOnSave": true
}