Shared config for prettier, so all our projects look nice and recognizable.
Once for a project.
npm i -D @igne-agency/prettier prettier
Add prettier to package.json
:
"prettier": "@igne-agency/prettier",
Add a script to run prettier in :
"scripts": {
"format": "prettier . --check"
}
Make sure to add a step to the pipeline of your project that runs this script.
For every developer.
- Install the prettier extension:
esbenp.prettier-vscode
- Open VSCode's
settings.json
and add:
"editor.defaultFormatter": "esbenp.prettier-vscode",
- Related settings you may want to add are:
"editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true,