diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index e34398e51d..85ce7cd602 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -1,7 +1,10 @@ #!/bin/sh FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') [ -z "$FILES" ] && exit 0 -echo "$FILES" | xargs pnpm format:fix --no-error-on-unmatched-pattern + +# Lint and format staged files +echo "$FILES" | xargs pnpm exec oxlint --fix 2>/dev/null || true +echo "$FILES" | xargs pnpm exec oxfmt --write 2>/dev/null || true echo "$FILES" | xargs git add exit 0