mirror of
https://github.com/seigler/dash-website
synced 2025-07-26 14:56:09 +00:00
17 lines
393 B
Bash
Executable file
17 lines
393 B
Bash
Executable file
#!/bin/bash
|
|
jsfiles=$(git diff --cached --name-only --diff-filter=M | grep '\.js\?$')
|
|
jsfailed=0
|
|
|
|
if [[ $jsfiles != "" ]] ; then
|
|
for file in ${jsfiles}; do
|
|
git show :$file | eslint --stdin --stdin-filename "$file"
|
|
if [[ $? != 0 ]] ; then
|
|
jsfailed=1
|
|
fi
|
|
done;
|
|
fi
|
|
|
|
if [[ $jsfailed != 0 ]] ; then
|
|
echo "🚫🚫🚫ESLint must pass before committing .js files"
|
|
exit 1
|
|
fi
|