feat: ESLint 정리 및 전체 코드 품질 개선
- eslint.config.mjs 규칙 강화 및 정리 - 전역 unused import/변수 제거 (312개 파일) - next.config.ts, middleware, proxy route 개선 - CopyableCell molecule 추가 - 회계/결재/HR/생산/건설/품질/영업 등 전 도메인 lint 정리 - IntegratedListTemplateV2, DataTable, MobileCard 등 공통 컴포넌트 개선 - execute-server-action 에러 핸들링 보강
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* 기존 ProcessDetail, ProcessForm 컴포넌트 활용
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { ProcessDetail } from './ProcessDetail';
|
||||
import { ProcessForm } from './ProcessForm';
|
||||
@@ -27,7 +27,7 @@ interface ProcessDetailClientV2Props {
|
||||
const BASE_PATH = '/ko/master-data/process-management';
|
||||
|
||||
export function ProcessDetailClientV2({ processId, initialMode }: ProcessDetailClientV2Props) {
|
||||
const router = useRouter();
|
||||
const _router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
// URL 쿼리에서 모드 결정
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
import { RuleModal } from './RuleModal';
|
||||
import { toast } from 'sonner';
|
||||
import type { Process, ClassificationRule, ProcessType, ProcessStep } from '@/types/process';
|
||||
import { PROCESS_TYPE_OPTIONS, PROCESS_CATEGORY_OPTIONS } from '@/types/process';
|
||||
import { PROCESS_CATEGORY_OPTIONS } from '@/types/process';
|
||||
import {
|
||||
createProcess,
|
||||
updateProcess,
|
||||
@@ -54,7 +54,7 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
|
||||
// 기본 정보 상태
|
||||
const [processName, setProcessName] = useState(initialData?.processName || '');
|
||||
const [processType, setProcessType] = useState<ProcessType>(
|
||||
const [processType, _setProcessType] = useState<ProcessType>(
|
||||
initialData?.processType || '생산'
|
||||
);
|
||||
const [department, setDepartment] = useState(initialData?.department || '');
|
||||
@@ -68,7 +68,7 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
const [isActive, setIsActive] = useState(
|
||||
initialData ? initialData.status === '사용중' : true
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [, setIsLoading] = useState(false);
|
||||
|
||||
// 중간검사/작업일지 설정 (Process 레벨)
|
||||
const [needsInspection, setNeedsInspection] = useState(
|
||||
@@ -122,7 +122,7 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
} else if (processCategory && !categoryOptions.find(o => o.value === processCategory)) {
|
||||
setProcessCategory('');
|
||||
}
|
||||
}, [categoryOptions]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [categoryOptions]);
|
||||
|
||||
// 개별 품목 목록 추출
|
||||
const individualItems = classificationRules
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function ProcessListClient({ initialData = [], initialStats }: Pr
|
||||
|
||||
// ===== 상태 =====
|
||||
const [allProcesses, setAllProcesses] = useState<Process[]>(initialData);
|
||||
const [stats, setStats] = useState(initialStats ?? { total: 0, active: 0, inactive: 0 });
|
||||
const [, setStats] = useState(initialStats ?? { total: 0, active: 0, inactive: 0 });
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
const [deleteTargetId, setDeleteTargetId] = useState<string | null>(null);
|
||||
@@ -100,11 +100,11 @@ export default function ProcessListClient({ initialData = [], initialStats }: Pr
|
||||
router.push('/ko/master-data/process-management?mode=new');
|
||||
}, [router]);
|
||||
|
||||
const handleEdit = useCallback((process: Process) => {
|
||||
const _handleEdit = useCallback((process: Process) => {
|
||||
router.push(`/ko/master-data/process-management/${process.id}?mode=edit`);
|
||||
}, [router]);
|
||||
|
||||
const handleDeleteClick = useCallback((processId: string) => {
|
||||
const _handleDeleteClick = useCallback((processId: string) => {
|
||||
setDeleteTargetId(processId);
|
||||
setDeleteDialogOpen(true);
|
||||
}, []);
|
||||
@@ -270,7 +270,7 @@ export default function ProcessListClient({ initialData = [], initialStats }: Pr
|
||||
|
||||
// API 액션
|
||||
actions: {
|
||||
getList: async (params?: ListParams) => {
|
||||
getList: async (_params?: ListParams) => {
|
||||
try {
|
||||
const [listResult, statsResult] = await Promise.all([
|
||||
getProcessList({ size: 1000 }),
|
||||
@@ -316,9 +316,9 @@ export default function ProcessListClient({ initialData = [], initialStats }: Pr
|
||||
{ key: 'drag', label: '', className: 'w-[40px]' },
|
||||
{ key: 'checkbox', label: '', className: 'w-[50px]' },
|
||||
{ key: 'no', label: '번호', className: 'w-[60px] text-center' },
|
||||
{ key: 'processCode', label: '공정번호', className: 'w-[120px]' },
|
||||
{ key: 'processName', label: '공정명', className: 'min-w-[200px]' },
|
||||
{ key: 'department', label: '담당부서', className: 'w-[120px]' },
|
||||
{ key: 'processCode', label: '공정번호', className: 'w-[120px]', copyable: true },
|
||||
{ key: 'processName', label: '공정명', className: 'min-w-[200px]', copyable: true },
|
||||
{ key: 'department', label: '담당부서', className: 'w-[120px]', copyable: true },
|
||||
{ key: 'items', label: '품목', className: 'w-[80px] text-center' },
|
||||
{ key: 'inspection', label: '중간검사', className: 'w-[90px] text-center' },
|
||||
{ key: 'workLog', label: '작업일지', className: 'w-[90px] text-center' },
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import type { Process } from '@/types/process';
|
||||
import { DocumentHeader, SectionHeader } from '@/components/document-system';
|
||||
import { DocumentHeader } from '@/components/document-system';
|
||||
|
||||
const getDocumentCode = (processName: string): string => {
|
||||
if (processName.includes('스크린')) return 'WL-SCR';
|
||||
|
||||
@@ -77,19 +77,19 @@ export function RuleModal({ open, onOpenChange, onAdd, editRule, processId, proc
|
||||
|
||||
// 공정/구분 필터 상태
|
||||
const [processFilter, setProcessFilter] = useState('all');
|
||||
const [categoryFilter, setCategoryFilter] = useState('all');
|
||||
const [, setCategoryFilter] = useState('all');
|
||||
|
||||
// 품목 목록 API 상태
|
||||
const [itemList, setItemList] = useState<ItemOption[]>([]);
|
||||
const [isItemsLoading, setIsItemsLoading] = useState(false);
|
||||
|
||||
// 품목 유형 옵션 (common_codes에서 동적 조회)
|
||||
const [itemTypeOptions, setItemTypeOptions] = useState<Array<{ value: string; label: string }>>([
|
||||
const [, setItemTypeOptions] = useState<Array<{ value: string; label: string }>>([
|
||||
{ value: 'all', label: '전체' },
|
||||
]);
|
||||
|
||||
// 구분 필터 옵션 (공정 필터에 따라 변경)
|
||||
const categoryFilterOptions = getCategoryFilterOptions(processFilter);
|
||||
const _categoryFilterOptions = getCategoryFilterOptions(processFilter);
|
||||
|
||||
// 품목 목록 로드
|
||||
const loadItems = useCallback(async (q?: string, itemType?: string) => {
|
||||
|
||||
@@ -120,7 +120,7 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) {
|
||||
const [isInspectionSettingOpen, setIsInspectionSettingOpen] = useState(false);
|
||||
const [isInspectionPreviewOpen, setIsInspectionPreviewOpen] = useState(false);
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [, setIsLoading] = useState(false);
|
||||
|
||||
// 검사여부가 "사용"인지 확인
|
||||
const isInspectionEnabled = needsInspection === '사용';
|
||||
|
||||
@@ -69,7 +69,7 @@ interface ApiProcessItem {
|
||||
};
|
||||
}
|
||||
|
||||
interface ApiResponse<T> {
|
||||
interface _ApiResponse<T> {
|
||||
success: boolean;
|
||||
message: string;
|
||||
data: T;
|
||||
|
||||
Reference in New Issue
Block a user