- Add GitHub Actions workflow for automated CI/CD - Configure Node.js 18.x and 20.x matrix testing - Add TypeScript type checking step - Add ESLint code quality checks with enhanced rules - Add Prettier formatting verification - Add production build validation - Upload build artifacts for deployment - Set up automated testing on push/PR - Replace console.log with environment-aware logger - Add pre-commit hooks for code quality - Exclude archive folder from linting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
885 B
Bash
Executable File
36 lines
885 B
Bash
Executable File
#!/usr/bin/env sh
|
|
. "$(dirname -- "$0")/_/husky.sh"
|
|
|
|
# Pre-commit 체크리스트
|
|
echo "🔍 Pre-commit 검사 시작..."
|
|
|
|
# 1. 코드 포맷팅 검사
|
|
echo "📝 코드 포맷팅 검사 중..."
|
|
npm run format:check
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ 코드 포맷팅 오류 발견. 'npm run format'으로 수정 후 다시 커밋하세요."
|
|
exit 1
|
|
fi
|
|
|
|
# 2. 린팅 및 포맷팅 자동 수정
|
|
echo "🔧 Lint-staged 실행 중..."
|
|
npx lint-staged
|
|
|
|
# 3. 타입 검사
|
|
echo "🎯 TypeScript 타입 검사 중..."
|
|
npm run type-check
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ TypeScript 타입 오류 발견. 수정 후 다시 커밋하세요."
|
|
exit 1
|
|
fi
|
|
|
|
# 4. 빌드 테스트 (선택적)
|
|
echo "🔨 빌드 테스트 중..."
|
|
npm run build
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ 빌드 실패. 코드를 확인하고 다시 커밋하세요."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ 모든 pre-commit 검사 통과!"
|