diff options
Diffstat (limited to '.husky/pre-commit')
| -rwxr-xr-x | .husky/pre-commit | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..32f797b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,54 @@ +echo "🔍 Running pre-commit checks..." + +# Run lint +echo "📋 Running lint..." +pnpm run lint +if [ $? -ne 0 ]; then + echo "❌ Lint failed" + exit 1 +fi + +# Run format +echo "🎨 Running format..." +pnpm run format +if [ $? -ne 0 ]; then + echo "❌ Format failed" + exit 1 +fi + +# Run format:code +echo "🎨 Running format:code..." +pnpm run format:code +if [ $? -ne 0 ]; then + echo "❌ Format:code failed" + exit 1 +fi + +# Run format:imports +echo "📦 Running format:imports..." +pnpm run format:imports +if [ $? -ne 0 ]; then + echo "❌ Format:imports failed" + exit 1 +fi + +# Run check +echo "✅ Running check..." +pnpm run check +if [ $? -ne 0 ]; then + echo "❌ Check failed" + exit 1 +fi + +# Check if dist directory exists before running lychee +if [ -d "dist" ]; then + echo "🔗 Running lychee check on dist directory..." + lychee src/content --no-progress --exclude-private --max-retries 1 --timeout 10 + if [ $? -ne 0 ]; then + echo "⚠️ Lychee found broken links (this won't block the commit)" + fi +else + echo "⚠️ Dist directory not found, skipping lychee check" +fi + +echo "✅ All pre-commit checks passed!" |
