@wayofdev/prettier-config
v1.1.0
Published
A shareable prettier configuration for projects.
Downloads
4
Readme
Prettier Config
Shareable prettier configuration.
Install
# using yarn
$ yarn add -D prettier @wayofdev/prettier-config
# using pnpm
$ pnpm add -Dw prettier @wayofdev/prettier-config
Usage
.prettierrc.js
module.exports = '@wayofdev/prettier-config';
Extending
.prettierrc.js
module.exports = {
...require('@wayofdev/prettier-config'),
semi: false,
};
Add an NPM Script
Running this command:
npm set-script lint:prettier "prettier --write ."
Will create:
package.json
...
"scripts": {
...
"lint:prettier": "prettier --write ."
...
},
...
Add a Pre-commit Hook
lint-staged.config.js
module.exports = {
'**/*': ['prettier --cache --write --ignore-unknown'],
};
License
MIT