Created
May 28, 2020 16:56
-
-
Save shannonmoeller/302ebe85315207467e239210658eb0ae to your computer and use it in GitHub Desktop.
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 | |
JS_FILES="$(git diff --name-only --staged --diff-filter=ACM | grep '.js$')" | |
if [ -n "$JS_FILES" ]; then | |
set -e | |
echo 'eslint' && ./node_modules/.bin/eslint --fix $JS_FILES | |
echo 'prettier' && ./node_modules/.bin/prettier --write $JS_FILES | |
echo 'git add' && git add $JS_FILES | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment