Create check_scripts.sh

This commit is contained in:
freearhey 2025-01-17 18:28:59 +03:00
parent 5958c77c65
commit d81b994161

8
.husky/check_scripts.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
scripts_changed="$(git diff --staged --name-only --diff-filter=ACMR -- 'tests/**/*.ts' 'tests/**/*.js' 'scripts/**/*.ts' 'scripts/**/*.mts' 'scripts/**/*.js' 'sites/**/*.js' 'sites/**/*.ts' | sed 's| |\\ |g')"
if [ ! -z "$scripts_changed" ]; then
echo "npx eslint $scripts_changed"
npx eslint $scripts_changed
fi