권한 시스템 통합: - BadDebtDetail, LaborDetail, PricingDetail 권한 로직 정리 - BoardDetail, ClientDetail, ItemDetail 권한 적용 개선 - ProcessDetail, StepDetail, PermissionDetail 권한 리팩토링 - ContractDetail, HandoverReport, ProgressBilling 권한 연동 - ReceivingDetail, ShipmentDetail, WorkOrderDetail 권한 적용 - InspectionDetail, OrderSalesDetail, QuoteFooterBar 권한 개선 기능 개선: - AuthenticatedLayout 구조 리팩토링 - JointbarInspectionDocument 문서 레이아웃 개선 - PricingTableForm 폼 기능 보강 - DynamicItemForm, SectionsTab 개선 - 주문관리 상세/생산지시 페이지 개선 - VendorLedgerDetail 수정 설정: - Claude hooks 추가 (빌드 차단, 파일 크기 체크, 미사용 import 체크) - 품질감사 문서관리 계획 문서 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
840 B
Bash
Executable File
30 lines
840 B
Bash
Executable File
#!/bin/bash
|
|
# PostToolUse Hook: Edit/Write 후 미사용 import 체크
|
|
# 단일 파일 eslint로 빠르게 체크 (전체 tsc보다 빠름)
|
|
|
|
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
|
|
|
|
# 파일 존재 확인
|
|
if [ ! -f "$FILE_PATH" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0
|
|
|
|
# eslint로 미사용 변수/import 체크 (단일 파일 → 빠름)
|
|
RESULT=$(npx eslint --no-eslintrc --rule '{"@typescript-eslint/no-unused-vars": "error"}' --parser @typescript-eslint/parser --plugin @typescript-eslint "$FILE_PATH" 2>&1 | grep "no-unused-vars" | head -10)
|
|
|
|
if [ -n "$RESULT" ]; then
|
|
echo "Unused imports/variables in $FILE_PATH:" >&2
|
|
echo "$RESULT" >&2
|
|
exit 2
|
|
fi
|
|
|
|
exit 0
|