al-quran.reflectslight.io/.husky/pre-commit
2023-10-28 12:14:40 -03:00

12 lines
273 B
Bash
Executable file

#!/usr/bin/env sh
pattern=".ts|.tsx|.js$"
files=$(git --no-pager diff --cached --name-only | grep -E -e "${pattern}")
if [ "$?" = "0" ]; then
npm run prettier -- -c ${files} || exit 1
npm run eslint -- ${files} || exit 1
git add "${files}"
exit 0
else
exit 0
fi