Files
sam-react-prod/.claude/hooks/typecheck-after-edit.sh
유병철 e111f7b362 feat(WEB): 권한 관리 시스템 구현 및 상세 페이지 권한 통합
- PermissionContext, usePermission 훅, PermissionGuard 컴포넌트 신규 추가
- AccessDenied 접근 거부 페이지 추가
- permissions lib (체커, 매퍼, 타입) 구현
- BadDebtDetail, BoardDetail, LaborDetail, PricingDetail 등 상세 페이지 권한 적용
- ProcessDetail, StepDetail, ItemDetail, PermissionDetail 권한 연동
- RootProvider에 PermissionProvider 통합
- protected layout 권한 체크 추가
- Claude 프로젝트 설정 파일 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:17:02 +09:00

25 lines
653 B
Bash
Executable File

#!/bin/bash
# PostToolUse Hook: Write/Edit 후 TypeScript 타입체크
# exit 0 = 성공, exit 2 = 에러 (Claude에 피드백)
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
# TypeScript 파일만 체크
if [[ "$FILE_PATH" != *.ts && "$FILE_PATH" != *.tsx ]]; then
exit 0
fi
# 프로젝트 디렉토리로 이동
cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0
# tsc 실행 (에러만 출력, 최대 20줄)
RESULT=$(npx tsc --noEmit 2>&1 | head -20)
if [ -n "$RESULT" ] && echo "$RESULT" | grep -q "error TS"; then
echo "TypeScript errors after editing $FILE_PATH:" >&2
echo "$RESULT" >&2
exit 2
fi
exit 0