NetOpWibby / config-prettier

Opinionated Prettier configuration

Home Page:https://npmjs.com/package/@webb/config-prettier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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.
"pre-commit": "npm run build && npm run pretty && npm run increment && git add -A :/"

About

Opinionated Prettier configuration

https://npmjs.com/package/@webb/config-prettier


Languages

Language:TypeScript 86.2%Language:Shell 13.8%