diff --git a/.husky/check_scripts.sh b/.husky/check_scripts.sh new file mode 100755 index 00000000..a29f7607 --- /dev/null +++ b/.husky/check_scripts.sh @@ -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 \ No newline at end of file