2026-01-15 16:00:30 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
|
|
# Generate TypeScript types from OpenAPI spec before commit
|
|
|
|
|
# This ensures types are always up-to-date with the backend API
|
|
|
|
|
cd apps/web && bash scripts/generate-types.sh
|
2026-01-16 12:04:49 +00:00
|
|
|
|
|
|
|
|
# Implicit 10.1: Type checking
|
|
|
|
|
# Prevent commits with TypeScript errors (warnings are allowed)
|
|
|
|
|
cd apps/web && npm run typecheck 2>&1 | grep -q "error TS" && {
|
|
|
|
|
echo "❌ Type checking failed. Please fix TypeScript errors before committing."
|
|
|
|
|
echo "💡 Run 'npm run typecheck' to see all errors."
|
|
|
|
|
exit 1
|
|
|
|
|
} || true
|
|
|
|
|
|
|
|
|
|
# Implicit 10.2: Linting
|
|
|
|
|
# Prevent commits with linting errors (warnings are allowed)
|
|
|
|
|
cd apps/web && npm run lint 2>&1 | grep -q "error" && {
|
|
|
|
|
echo "❌ Linting failed. Please fix linting errors before committing."
|
|
|
|
|
echo "💡 Tip: Run 'npm run lint:fix' to automatically fix some issues."
|
|
|
|
|
exit 1
|
|
|
|
|
} || true
|