Show More
Commit Commit message Age Author Refs
r6:71691d7f59ac
Upgraded deps
0
r5:396a7fce745f
Updated deps and removed private registry
0
r4:328cec0d04b0
Updated README
0
r3:a5131c816d34
Updated export
0
r2:e702fb79783d
Updated export
0
r1:386906ddf4c7
Added editorconfig
0
r0:0b57c43955fd
Initial commit
0
< 1 >

@webb/config-prettier

Opinionated Prettier configuration

Install

# Install this module, with Prettier
$ npm i @webb/config-prettier prettier -D

Usage

Add this line to your package.json file:

"prettier": "@webb/config-prettier"

And then in your scripts block:

// This example is processing JavaScript and TypeScript files
// in the "dist" folder. Update these paths for your project.
"pretty": "prettier --write 'dist/**/*.js' 'dist/**/*.ts'"

You can find more CLI parameters here.

It's a good idea to run Prettier in a precommit script, like so:

// This example runs a "build" script, the "pretty" script
// we created above, an "increment" script to update the
// version parameter of "package.json", and finally stages
// all the changes for committing to git.
//
// Note that this example requires the installation of Husky.
"husky": {
  "hooks": {
    "pre-commit": "npm run build && npm run pretty && npm run increment && git add -A :/"
  }
}