Skip to content

Instantly share code, notes, and snippets.

@hypnoglow
Last active May 23, 2016 10:10
Show Gist options
  • Save hypnoglow/a65e24b69858da6095f306eda4d96ac8 to your computer and use it in GitHub Desktop.
Save hypnoglow/a65e24b69858da6095f306eda4d96ac8 to your computer and use it in GitHub Desktop.
eslint git hook
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