mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-22 19:06:12 +00:00
ad511db0fe
I figured that lint:fix might not be the best experience: If there are linting errors and the pre-commit fixes them, those changes will stay in the staging area but will not be automatically commited. Thus, a subsequent pre-commit check would succeed without these changes included.
18 lines
528 B
Bash
18 lines
528 B
Bash
#!/bin/sh
|
|
|
|
echo "🔍 Running pre-commit hook to check the code looks good... 🔍"
|
|
|
|
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
|
|
|
|
if ! pnpm lint; then
|
|
echo "❌ Linting failed! 'pnpm lint:check' will help you fix the easy ones."
|
|
echo "Once you're done, don't forget to add your beautification to the commit! 🤩"
|
|
exit 1
|
|
fi
|
|
|
|
echo "👍 All good! Committing changes..."
|