prettier-config-kbshl

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i prettier-config-kbshl

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

6.25 kB

Total Files

6

Last publish

Collaborators

  • kbshl