2.0.0 • Published 5 years ago

prettier-config-kbshl v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

prettier-config-kbshl

Commitizen friendly NPM NPM total downloads NPM license GitHub stars

Prettier shareable configuration for my Javascript based projects (Web and Mobile)

Installation

npm install --save-dev prettier-config-kbshl

Usage

.prettierrc.js

module.exports = require('prettier-config-kbshl');

.prettierignore

Copy and paste the following snippet:

### Node ###
node_modules
**/package.json
**/package-lock.json

### Builds ###
dist
coverage
build

### VSCode ###
.vscode
.history

### Titanium Mobile ###
Resources
app/widgets
./i18n
./platform

or do something like this:

cat ./node_modules/prettier-config-kbshl/.prettierignore >> .prettierignore

package.json

e.g.

...
"scripts": {
  "format": "prettier --write \"src/**/*.+(js|ts|vue|json)\""
}
...

Recommendations

I recommend to use Prettier together with husky and lint-staged as a pre-commit git hook.

Installation

npm install --save-dev husky lint-staged

Usage

package.json

e.g.

...
"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
},
"lint-staged": {
  "**/*.+(js|ts|vue|json|css|sass|less|graphql|yml|yaml|scss|md)": [
    "prettier --write",
    "git add",
  ]
}
...

License

MIT © Konstantin Büschel