11#! /bin/sh
22
3- echo " 🔍 Running pre-commit hook to check the code looks good ... 🔍"
3+ echo " 🔍 Running pre-commit hook to check staged files ... 🔍"
44
55# Load NVM if available (useful for managing Node.js versions)
66export NVM_DIR=" $HOME /.nvm"
@@ -13,27 +13,19 @@ if ! command -v pnpm >/dev/null 2>&1; then
1313 exit 1
1414fi
1515
16- # Run typecheck
17- echo " Running typecheck ..."
18- if ! pnpm typecheck ; then
19- echo " ❌ Type checking failed! Please review TypeScript types ."
16+ # Run lint-staged on staged files only
17+ echo " Running lint-staged on staged files ..."
18+ if ! pnpm lint-staged ; then
19+ echo " ❌ Lint-staged failed! Please review the issues above ."
2020 echo " Once you're done, don't forget to add your changes to the commit! 🚀"
2121 exit 1
2222fi
2323
24- # Run lint
25- echo " Running lint..."
26- if ! pnpm lint; then
27- echo " ❌ Linting failed! Run 'pnpm lint:fix' to fix the easy issues."
28- echo " Once you're done, don't forget to add your beautification to the commit! 🤩"
29- exit 1
30- fi
31-
32- # Check Prettier formatting
33- echo " Checking Prettier formatting..."
34- if ! pnpm exec prettier --check . ; then
35- echo " ❌ Prettier formatting check failed! Run 'pnpm run lint:fix' to fix formatting."
36- echo " Once you're done, don't forget to add your formatting changes to the commit! ✨"
24+ # Run typecheck (still needed for full project context)
25+ echo " Running TypeScript typecheck..."
26+ if ! pnpm typecheck; then
27+ echo " ❌ TypeScript type checking failed! Please review type errors."
28+ echo " Once you're done, don't forget to add your changes to the commit! 🚀"
3729 exit 1
3830fi
3931
0 commit comments