Last Updated: February 25, 2016
·
377
· valentinzberea

pre-commit hook for coffee-jshint

git diff --staged --name-only | xargs coffee-jshint -g define,$,_,loader,Constants,Utils,setTimeout
if [[ $? -ne 0 ]]; then
  echo 'WARNING: You are about to commit files with coffee-jshint warnings'
  exit 1
fi

Couldn't make this pre-commit hook work due to the fact that globals in ~/.jshintrc weren't discovered. So I've modified it just a bit by adding globals flag in it.