mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 00:20:45 +00:00
lint: hook for precommit (#2245)
This commit is contained in:
+16
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user