refactor(lint): cross-feature 내부 import 금지 (boundaries) + barrel 경유 정리 (P2-3)#127
Conversation
…리 (P2-3)
- eslint-plugin-boundaries 도입: feature 는 다른 feature 를 barrel(index.ts) 로만
import 하도록 boundaries/entry-point 로 강제 (같은 feature 내부/ app.module 은 비대상)
- user 서비스·모듈 6곳의 deep-path cross-feature import 를 barrel 경유로 정리:
- user-{wishlist,recent-view}.service → @/features/product (ProductRepository)
- user-{order,mypage}.service → @/features/order (OrderRepository)
- user.module → @/features/{order,product} (Order/ProductModule)
- 위반 0건. 향후 cross-feature 내부 결합 회귀 방지.
NOTE: boundaries/entry-point 는 v6 에서 deprecated(→ boundaries/dependencies).
신규 API 가 default-disallow 라 #126 no-restricted 와 중복·충돌 소지가 있어
현 시점은 검증된 entry-point 유지. 마이그레이션은 후속 과제(Tech Debt)로 분리.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Coverage report
Test suite run success1254 tests passing in 146 suites. Report generated by 🧪jest coverage report action from d49dd6c |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
플랜 P2-3의 cross-feature 경계 강화입니다 (#126 코어에 이어).
eslint-plugin-boundaries로 "feature 는 다른 feature 를 barrel(index.ts) 로만 import" 를 자동 강제하고, 기존에 deep-path 로 다른 feature 내부 파일을 직접 참조하던 6곳을 barrel 경유로 정리했습니다.CLAUDE.md "features 가 다른 features 의 내부 파일을 직접 import 금지 → Module export provider 로 주입" 룰을 사람 규율이 아니라 lint 로 강제합니다.
Scope
신규 의존성:
eslint-plugin-boundaries(devDependency)eslint.config.mjssrc/features/*, family capture)boundaries/entry-point: feature 타깃은index.ts로만 import 허용 (비-feature 요소는 임의 파일 허용). 같은 feature 내부 import 와app.module(src 루트, 미분류) 의 import 는 검사 대상 아님 — 진짜 cross-feature 내부 결합만 차단boundaries/ignore로 제외import 정리 (6곳, deep-path → barrel)
user-wishlist.service·user-recent-view.service→@/features/product(ProductRepository)user-order.service·user-mypage.service→@/features/order(OrderRepository)user.module→@/features/order·@/features/product(Order/ProductModule)진행 상황
Impact
boundaries/entry-point는 v6 에서 deprecated (→boundaries/dependencies). 신규 API 는 default-disallow 라 refactor(lint): import/no-cycle 활성화 + common/global 모듈 경계 ESLint 강제 (P2-3) #126 의 no-restricted-imports 방향 룰과 중복·충돌 소지가 있어, 현 시점은 검증된 entry-point 를 유지.dependencies마이그레이션은 Tech Debt 로 분리 추적.Test plan
There is no rule allowing dependencies from feature/user to feature/order)yarn validate(lint + tsc + dto:check + test:cov) 통과 — 1254 tests, 146 suites