javascript-precommit

Installs git precommit hook for running checks & lints before git commit. Inspired by https://github.com/nlf/precommit-hook


License
CC-BY-NC-SA-3.0
Install
npm install javascript-precommit@0.0.8

Documentation

Installs git precommit hook for running lints & checks before git commit.

Usage

  1. Make sure your .git dir is on the same path as package.json. In other words, they share the same parent folder. Usually it is so.
  2. Edit your package.json, add precommit: <what to do>, e.g.
{ 
  "name": "My package.json",
  "precommit": "gulp lint"
}
  1. npm i javascript-precommit

Now every git commit will run gulp lint task and only pass if the task is successful.