Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$')
  4. do
  5. 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
  6. if [ $? -ne 0 ]; then
  7. echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via yarn lint."
  8. exit 1 # exit with failure status
  9. fi
  10. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement