Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
- do
- git show ":$file" | node_modules/.bin/eslint --config .eslintrc.yml --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
- if [ $? -ne 0 ]; then
- echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via yarn lint."
- exit 1 # exit with failure status
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement