Fix .husky/pre-commit
This commit is contained in:
parent
678aa186ea
commit
4525fbe416
1 changed files with 3 additions and 3 deletions
|
@ -1,10 +1,10 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
pattern=".ts|.tsx|.js$"
|
pattern="\.ts|\.tsx|\.js$"
|
||||||
files=$(git --no-pager diff --cached --name-only | grep -E -e "${pattern}")
|
files=$(git --no-pager diff --cached --name-only | grep -E -e "${pattern}")
|
||||||
if [ "$?" = "0" ]; then
|
if [ "$?" = "0" ]; then
|
||||||
npm run prettier -- -c ${files} || exit 1
|
npm run prettier -- ${files} || exit 1
|
||||||
npm run eslint -- --exit-on-fatal-error ${files} || exit 1
|
npm run eslint -- --fix --exit-on-fatal-error ${files} || exit 1
|
||||||
git add "${files}"
|
git add "${files}"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue