0.9.0 • Published 5 years ago

@build-chores/staged v0.9.0

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
5 years ago

@build-chores/staged

Staging JS projects is complicated.

Synopsis

License: GPL v3 npm version Build Status

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.

License