Skip to content

Commit d7aa1ad

Browse files
committed
Update husky pre-commit and pre-push hooks
1 parent 17a2858 commit d7aa1ad

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

.husky/pre-commit

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@ if [ -f "$HOME/.nvm/nvm.sh" ]; then
1515
fi
1616
fi
1717

18-
# Run TypeScript check (fast feedback on type errors)
19-
npm run check
20-
21-
# Run linters (fail fast on each)
22-
npm run lint:style
23-
npm run lint:code
24-
npm run lint:json
25-
26-
# Run unit tests (fast feedback)
27-
npm run test:unit
18+
# Run lint suite (includes TypeScript check + ESLint + Stylelint + JSON formatting)
19+
npm run lint
2820

2921
# Verify branch naming convention
3022
.husky/scripts/check-branch-name.sh

.husky/pre-push

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
# Load nvm if available and use appropriate node version
4+
if [ -f "$HOME/.nvm/nvm.sh" ]; then
5+
. "$HOME/.nvm/nvm.sh"
6+
if nvm use 2>/dev/null; then
7+
echo "Using current nvm node version"
8+
elif nvm use node 2>/dev/null; then
9+
echo "Using latest nvm node version"
10+
elif nvm use --lts 2>/dev/null; then
11+
echo "Using LTS node version"
12+
else
13+
echo "Using system node version"
14+
fi
15+
fi
16+
17+
# Pushes must pass lint, unit, and e2e test suites
18+
npm run lint
19+
npm run test:unit
20+
DEBUG=1 npm run test:e2e

0 commit comments

Comments
 (0)