Skip to content

Instantly share code, notes, and snippets.

@dekadentno
Created August 1, 2018 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekadentno/09305a127a731737b387160786a0df8d to your computer and use it in GitHub Desktop.
Save dekadentno/09305a127a731737b387160786a0df8d to your computer and use it in GitHub Desktop.
Git hook for running eslint before commit
#!/bin/sh
function lintit () {
e=$(eslint . --ext .vue src/*)
echo $e
if [[ "$e" != *"0 problems"* ]]; then
echo "ERROR: Fix eslint errors before commiting your code!"
exit 1 # reject
fi
}
lintit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment