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.
Written by Valentin Zberea
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Coffeescript
Authors
iam4x
94.17K
ericdfields
63.02K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#