Skip to content

[#8] Refactor imports and clean up code structure across multiple components #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

wooder2050
Copy link
Collaborator

✅ 주요 작업 내용

1. 🧹 프로젝트 전체 린트 에러 해결
  • simple-import-sort/imports:
    • 여러 파일에서 import 순서가 올바르지 않던 문제를 규칙(외부 라이브러리 → 절대 경로 → 상대 경로)에 맞게 수동으로 정렬했습니다.
  • @typescript-eslint/no-unused-vars:
    • 사용하지 않는 변수와 타입을 제거하여 코드를 간결하게 정리했습니다.
  • react/no-unescaped-entities:
    • JSX 내부에 일반 텍스트로 사용된 따옴표 등의 특수문자를 HTML 엔티티로 변환하여 잠재적인 렌더링 오류를 방지했습니다.
  • react-hooks/rules-of-hooks:
    • 조건부로 호출되던 React Hook의 순서를 조정하여 'Rules of Hooks' 위반 문제를 해결했습니다.
2. 🔩 src/features/matches/api.ts 리팩토링 및 안정화
  • 배경: any 타입을 과도하게 사용하여 타입 안정성이 부족하고 유지보수가 어려웠습니다.
  • 시도: any 타입을 제거하고 명확한 타입을 정의하려 했으나, Supabase의 join 데이터 구조(항상 배열로 반환)와 선수 출전 상태를 판별하는 복잡한 로직 때문에 타입 에러와 연쇄적인 버그가 발생했습니다.
  • 최종 조치:
    • 수많은 시도 끝에, 타입 안정성 확보보다는 기능적 완전성을 우선하기로 결정했습니다.
    • substitutions 테이블 정보까지 활용하여 선발/교체/벤치 상태를 가장 정교하게 계산하는 안정적인 버전으로 코드를 복원했습니다.
    • 일시적으로 any 타입과 eslint-disable 주석을 허용하고, // TODO 주석을 추가하여 향후 리팩토링이 필요함을 명시했습니다.

@wooder2050 wooder2050 self-assigned this Jul 9, 2025
Copy link

sonarqubecloud bot commented Jul 9, 2025

@wooder2050 wooder2050 merged commit de6fe3c into main Jul 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant