🎉 first commit
This commit is contained in:
32
.husky/pre-commit
Normal file
32
.husky/pre-commit
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "🔍 Running pre-commit hook to check the code looks good... 🔍"
|
||||
|
||||
# Load NVM if available (useful for managing Node.js versions)
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
# Ensure `pnpm` is available
|
||||
echo "Checking if pnpm is available..."
|
||||
if ! command -v pnpm >/dev/null 2>&1; then
|
||||
echo "❌ pnpm not found! Please ensure pnpm is installed and available in PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run typecheck
|
||||
echo "Running typecheck..."
|
||||
if ! pnpm typecheck; then
|
||||
echo "❌ Type checking failed! Please review TypeScript types."
|
||||
echo "Once you're done, don't forget to add your changes to the commit! 🚀"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run check
|
||||
echo "Running check..."
|
||||
if ! pnpm check:stage; then
|
||||
echo "❌ Check failed! Run 'pnpm check:stage' to fix the easy issues."
|
||||
echo "Once you're done, don't forget to add your beautification to the commit! 🤩"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "👍 All checks passed! Committing changes..."
|
||||
Reference in New Issue
Block a user