@spencerlepine/prettier-formatter-config
v1.0.0
Published
Shared Prettier configuration to enforce standard code formatting
Downloads
6
Readme
Spencer's Prettier Formatter Config
Shared Prettier configuration to enforce standard code formatting, along with Husky + Lint-Staged (for a pre-commit hook)
Setup
- Install the package:
npm install @spencerlepine/prettier-formatter-config --save-dev
npm install [email protected] [email protected] [email protected] --save-dev
- Update your
package.json
:
{
"name": "@org/example-package",
// ...
"scripts": {
"format": "prettier --write ."
},
"prettier": "@spencerlepine/prettier-formatter-config",
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.(js|jsx|ts|tsx|json|css|md)": [
"prettier --write"
]
}
}
- (optional) One-time cleanup to format the entire codebase
npx prettier --write .