To install:
curl -o .git/hooks/pre-commit http://git.io/jSry
chmod +x .git/hooks/pre-commit
#!/bin/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
./node_modules/eslint/bin/eslint.js . | |
rc=$? | |
if [[ $rc != 0 ]]; then | |
echo "---- | |
----> Error: Your code doesn't lint! Fix that before commiting. | |
----" | |
exit 1 | |
fi |