@build-chores/staged
v0.9.0
Published
Staging JS projects is complicated.
Downloads
14
Readme
@build-chores/staged
Staging JS projects is complicated.
Synopsis
Stage files of your JS project before committing them with git.
Usage
Install the @build-chores/staged
package into your project:
yarn install --dev @build-chores/staged
Use Husky to lint your stage whenever you commit.
yarn add --dev husky
Place a pre-commit
hook in your .huskyrc
. The following example hook only lints your stage when committing to the master
branch. See the example .huskyrc
for a template.
{
"hooks": {
"pre-commit": "! git rev-parse --abbrev-ref HEAD | grep -q master || lint-staged -c @build-chores/staged"
}
}
To make sure that prettier
isn't touching the package.json
file during staging, place a .prettierignore
file. See the example .prettierignore
for a template.
package.json
You are ready to lint your staged files before committing.
Contribute
Check out our contributing.md to get started.