@build-chores/staged

Staging JS projects is complicated.

Usage no npm install needed!

<script type="module">
  import buildChoresStaged from 'https://cdn.skypack.dev/@build-chores/staged';
</script>

README

@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