Last active
October 22, 2018 20:52
-
-
Save yyx990803/1a0aa30ff5ffc7fca74f to your computer and use it in GitHub Desktop.
pre-commit hook for Vue.js
This file contains hidden or 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
#!/usr/bin/env bash | |
# get files to be linted | |
FILES=$(git diff --cached --name-only | grep -E '^src|^test/unit/specs|^test/e2e') | |
# lint them if any | |
if [[ $FILES ]]; then | |
./node_modules/.bin/eslint $FILES | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment