lint: hook for precommit (#2245)

This commit is contained in:
Daniel Salazar
2026-01-06 16:45:05 -08:00
committed by GitHub
parent 677426cbe7
commit 1642431615
+16 -1
View File
@@ -1 +1,16 @@
node tools/validate-eslint.js
#!/usr/bin/env sh
set -e
node tools/validate-eslint.js
tmpfile="$(mktemp)"
git diff --cached --name-only -z --diff-filter=ACMR -- \
'*.js' '*.mjs' '*.cjs' '*.jsx' '*.ts' '*.tsx' '*.vue' \
> "$tmpfile"
if [ -s "$tmpfile" ]; then
xargs -0 eslint --fix < "$tmpfile"
xargs -0 git add < "$tmpfile"
fi
rm -f "$tmpfile"