Created
August 1, 2018 15:13
-
-
Save dekadentno/09305a127a731737b387160786a0df8d to your computer and use it in GitHub Desktop.
Git hook for running eslint before commit
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
#!/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