Last active
February 14, 2022 12:02
-
-
Save felippenardi/7810b0824f47bf838eb2c8a75a09e560 to your computer and use it in GitHub Desktop.
Shell script to Run Eslint only on modified files
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
#!/bin/bash | |
CHANGED_FILES=`git diff origin/master...HEAD --name-only` | |
node_modules/eslint/bin/eslint.js -f json $CHANGED_FILES --quiet | node_modules/eslines/index.js --quiet | |
if [[ $? != 0 ]] ; then | |
echo "Fix style violations" | |
exit 1 | |
fi | |
echo "All changed files are good" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment