@telefonica/prettier-config
v2.0.0
Published
## Install
Downloads
1,211
Readme
prettier-config
Install
Add prettier
and this package to your devDependencies
yarn add --dev prettier @telefonica/prettier-config
or
npm i --save-dev prettier @telefonica/prettier-config
Usage
Add to your package.json
:
"prettier": "@telefonica/prettier-config"
Configure pre-commit
hook
You may want to configure a pre-commit
hook, to enforce code style on commit.
You will need to add two dev dependencies: husky
and lint-staged
:
yarn add --dev husky lint-staged
or
npm i --save-dev husky lint-staged
Then add the following configuration to your package.json
:
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,tsx,js,json,md,yml,yaml}": [
"prettier --write"
]
}
Contribute
Please, open an issue if you want to discuss a rule or add a new configuration