Installation
When using npm, you can use
npm install --save-dev prettierConfiguration
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
}