- 해경 관련 코드/에셋 정리 (KCGV, 해경관할구역 FGB, PatrolShipSelector) - 위성/기상/퍼블리시/레거시 모듈 전체 삭제 - STOMP WebSocket → AIS Target API HTTP 폴링 방식 전환 - 세션 인증 임시 비활성화 (VITE_DEV_SKIP_AUTH) - 환경변수 민간 데모용으로 재구성 - 팀 워크플로우 v1.2.0 구조 적용 (.claude/rules, skills, settings) - .githooks, .editorconfig, .node-version 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.5 KiB
Bash
Executable File
37 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
#==============================================================================
|
|
# pre-commit hook (React JavaScript)
|
|
# ESLint 검증 — 실패 시 커밋 차단
|
|
#==============================================================================
|
|
|
|
# npm 확인
|
|
if ! command -v npx &>/dev/null; then
|
|
echo "경고: npx가 설치되지 않았습니다. 검증을 건너뜁니다."
|
|
exit 0
|
|
fi
|
|
|
|
# node_modules 확인
|
|
if [ ! -d "node_modules" ]; then
|
|
echo "경고: node_modules가 없습니다. 'yarn install' 실행 후 다시 시도하세요."
|
|
exit 0
|
|
fi
|
|
|
|
# ESLint 검증 (설정 파일이 있는 경우만)
|
|
if [ -f ".eslintrc.js" ] || [ -f ".eslintrc.json" ] || [ -f ".eslintrc.cjs" ] || [ -f "eslint.config.js" ] || [ -f "eslint.config.mjs" ]; then
|
|
echo "pre-commit: ESLint 검증 중..."
|
|
npx eslint src/ --ext .js,.jsx --quiet 2>&1
|
|
LINT_RESULT=$?
|
|
|
|
if [ $LINT_RESULT -ne 0 ]; then
|
|
echo ""
|
|
echo "╔══════════════════════════════════════════════════════════╗"
|
|
echo "║ ESLint 에러! 커밋이 차단되었습니다. ║"
|
|
echo "║ 'npx eslint src/ --fix'로 자동 수정을 시도해보세요. ║"
|
|
echo "╚══════════════════════════════════════════════════════════╝"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
|
|
echo "pre-commit: ESLint 통과"
|
|
fi
|