Skip to content

refactor(lint): import/no-cycle 활성화 + common/global 모듈 경계 ESLint 강제 (P2-3)#126

Merged
chanwoo7 merged 1 commit into
developfrom
refactor/eslint-import-cycle-and-boundaries
Jun 3, 2026
Merged

refactor(lint): import/no-cycle 활성화 + common/global 모듈 경계 ESLint 강제 (P2-3)#126
chanwoo7 merged 1 commit into
developfrom
refactor/eslint-import-cycle-and-boundaries

Conversation

@chanwoo7
Copy link
Copy Markdown
Member

@chanwoo7 chanwoo7 commented Jun 3, 2026

Summary

리팩토링 플랜 P2-3(ESLint import/no-cycle 활성화 + 모듈 경계 강화)의 코어를 적용합니다. CLAUDE.md 의 의존성 방향 룰을 사람 규율이 아니라 ESLint 로 자동 강제해, 경계 위반·순환참조가 PR 단계에서 잡히게 합니다.

신규 의존성 없이(eslint-plugin-import 기존 설치) 적용했고, 기존 코드 위반 0건이라 회귀 방지 성격입니다.

cross-feature 내부 import 강제(features 간 직접 import 금지)는 별도 결정사항으로 분리했습니다 — 아래 진행 상황 참조.

Scope

변경: eslint.config.mjs

  • import/no-cycle 활성화 (error, ignoreExternal) — 현재 순환참조 0건
  • no-restricted-imports 경계 룰 3종 추가:
    • src/common/**@/features·@/global·@/prisma import 금지 (common → 무의존)
    • src/common/utils/** → 위 + @nestjs/commonInjectable/Inject·@nestjs/config import 금지 (순수 함수 보장). DI 없는 값 클래스(HttpException 류)는 허용
    • src/global/**@/features·@/prisma import 금지 (global → common, config)

진행 상황

플랜 P2 잔여, 자율 진행 중.

Impact

  • FE / DB / 런타임: 영향 없음 (lint 설정만).
  • CI: lint 단계에서 경계·순환참조 위반을 차단. 현재 위반 0건이라 통과.
  • 개발 경험: common/global 에서 잘못된 방향 import 시 즉시 lint 에러.

Test plan

  • npx eslint 'src/**/*.ts' — 새 규칙 위반 0건
  • yarn lint — 0 errors (기존 미사용 import 경고 1건은 무관)
  • yarn validate (pre-push) 통과
  • CI 통과 확인

…P2-3 코어)

- import/no-cycle 활성화 (현재 위반 0건, 순환참조 회귀 방지)
- no-restricted-imports 로 CLAUDE.md 의존성 방향 룰 강제:
  - common → features/global/prisma 의존 금지 (common → 무의존)
  - common/utils → DI(Injectable/Inject)·ConfigService·Prisma 의존 금지
    (DI 없는 값 클래스 HttpException 류는 허용 — finding 5)
  - global → features/prisma 의존 금지 (global → common, config)
- 신규 의존성 없음 (eslint-plugin-import 기존 설치). 기존 코드 위반 0건.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: de374a5f-8c27-412d-8a17-b99968533e5d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/eslint-import-cycle-and-boundaries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 97.42% 3555/3649
🟢 Branches 93.83% 1125/1199
🟢 Functions 94.09% 653/694
🟢 Lines 97.66% 3253/3331

Test suite run success

1254 tests passing in 146 suites.

Report generated by 🧪jest coverage report action from d155da7

@chanwoo7 chanwoo7 merged commit 011d5f6 into develop Jun 3, 2026
10 checks passed
@chanwoo7 chanwoo7 deleted the refactor/eslint-import-cycle-and-boundaries branch June 3, 2026 19:14
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