@bitperfect-software/prettier-config
Company wide Prettier config.
Usage
Install:
yarn add --dev prettier @bitperfect-software/prettier-config
Edit package.json
:
{
"scripts": {
"reformat": "prettier --write ."
},
"prettier": "@bitperfect-software/prettier-config"
}
Optional steps
Extend ESLint rules
Install:
yarn add --dev eslint-config-prettier
Edit package.json
:
"eslintConfig": {
"extends": [
// ...
"prettier"
]
},
Setup WebStorm/PhpStorm to use Prettier as default formatter
To use Prettier as formatter on Ctrl+Alt+L
(in the current project):
- Open the Settings/Preferences dialog (Ctrl+Alt+S), go to Languages and Frameworks | JavaScript | Prettier, and select the On save checkbox.
- Select the On code reformat checkbox
- Optionally, enable On save as well