Last active
May 23, 2016 10:10
-
-
Save hypnoglow/a65e24b69858da6095f306eda4d96ac8 to your computer and use it in GitHub Desktop.
eslint git hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lint_it() { | |
changed_js_files=$( git diff --name-only HEAD | grep -E '(.js)$' ) | |
if [ -z "${changed_js_files}" ] ; then | |
return 0 | |
fi | |
eslint ${changed_js_files} | |
return $? | |
} | |
lint_it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment