epg/.husky/check_scripts.sh
2025-01-17 18:28:59 +03:00

8 lines
No EOL
340 B
Bash
Executable file

#!/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