Skip to content

Commit 4d7ea74

Browse files
committed
chore(husky): run biome only on staged files in pre-commit
- replaced full-repo formatting with per-commit checks - pre-commit hook now runs: • biome lint --apply • biome format --write - re-adds fixed files to staging automatically
1 parent 17ed404 commit 4d7ea74

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
pnpm lint:fix && git add .
1+
#!/bin/sh
2+
# .husky/pre-commit
3+
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(ts|tsx|js|json|md)$')
4+
[ -z "$FILES" ] && exit 0
5+
6+
echo "$FILES" | xargs biome check --write
7+
git add $FILES

0 commit comments

Comments
 (0)