Skip to content

Commit e92f0b9

Browse files
committed
fix(hooks): propagate lint-staged exit code from husky pre-commit
The wrapper ran 'bun run lint:staged' and then unconditionally printed '✅ Pre-commit checks passed.' regardless of the exit code, so failed eslint-fix runs (which lint-staged handles by reverting all task modifications, including prettier --write) silently let unformatted or lint-failing blobs land. Add 'set -e' so a non-zero lint-staged exit aborts the commit, which is what every other contributor expected. Made-with: Cursor
1 parent ff18c8b commit e92f0b9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/hooks/pre-commit.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/sh
2+
set -e
23

34
echo "🔍 Running pre-commit checks..."
45

5-
# Run lint-staged (ESLint, Prettier, Stylelint on staged files)
6+
# Run lint-staged (ESLint, Prettier, Stylelint on staged files).
7+
# Note: `set -e` above propagates any non-zero exit so husky aborts the
8+
# commit instead of letting unformatted/lint-failing files land.
69
bun run lint:staged
710

811
echo "✅ Pre-commit checks passed."

0 commit comments

Comments
 (0)