Skip to content

[FEAT] add eslint rule for detecting fsd cross layer imports#2

Merged
kyh0726 merged 8 commits into
mainfrom
1-feature-add-eslint-rule-for-detecting-fsd-cross-layer-imports
Nov 28, 2025
Merged

[FEAT] add eslint rule for detecting fsd cross layer imports#2
kyh0726 merged 8 commits into
mainfrom
1-feature-add-eslint-rule-for-detecting-fsd-cross-layer-imports

Conversation

@kyh0726

@kyh0726 kyh0726 commented Nov 28, 2025

Copy link
Copy Markdown
Owner

Description

Please include a summary of the changes and the related issue.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@kyh0726 kyh0726 self-assigned this Nov 28, 2025
@kyh0726 kyh0726 added the enhancement New feature or request label Nov 28, 2025
@kyh0726 kyh0726 linked an issue Nov 28, 2025 that may be closed by this pull request
@github-actions

github-actions Bot commented Nov 28, 2025

Copy link
Copy Markdown

✅ 테스트 결과

총 60개 테스트 | ✅ 60개 통과

🔍 Node 18.x 테스트 결과
> @yh-kim/eslint-plugin-fsd@0.1.9 test
> mocha tests/**/*.js
✅ All tests passed for no-cross-layer-import rule!
  no-cross-layer-import
    valid
      ✔ [app → pages] import 허용
      ✔ [pages → widgets] import 허용
      ✔ [widgets → features] import 허용
      ✔ [features → entities] import 허용
      ✔ [entities → shared] import 허용
      ✔ [entities → entities] 같은 레이어 내 import 허용
      ✔ [pages] 외부 패키지 import 허용
      ✔ [non-FSD] FSD 레이어가 아닌 파일은 체크 안함
      ✔ [features → entities] require 문법 허용
      ✔ [features → entities] dynamic import 허용
      ✔ [features → entities] 상대 경로 import 허용
    invalid
      ✔ [pages ✗ app] 상위 레이어 import 불가
      ✔ [widgets ✗ pages] 상위 레이어 import 불가
      ✔ [features ✗ widgets] 상위 레이어 import 불가
      ✔ [entities ✗ features] 상위 레이어 import 불가
      ✔ [shared ✗ entities] 상위 레이어 import 불가
      ✔ [shared ✗ app] 여러 레이어 건너뛰기 불가
      ✔ [features ✗ widgets] require 문법도 체크
      ✔ [widgets ✗ pages] dynamic import도 체크
      ✔ [entities ✗ pages] 상대 경로도 체크
  20 passing (66ms)
🔍 Node 20.x 테스트 결과
> @yh-kim/eslint-plugin-fsd@0.1.9 test
> mocha tests/**/*.js
✅ All tests passed for no-cross-layer-import rule!
  no-cross-layer-import
    valid
      ✔ [app → pages] import 허용
      ✔ [pages → widgets] import 허용
      ✔ [widgets → features] import 허용
      ✔ [features → entities] import 허용
      ✔ [entities → shared] import 허용
      ✔ [entities → entities] 같은 레이어 내 import 허용
      ✔ [pages] 외부 패키지 import 허용
      ✔ [non-FSD] FSD 레이어가 아닌 파일은 체크 안함
      ✔ [features → entities] require 문법 허용
      ✔ [features → entities] dynamic import 허용
      ✔ [features → entities] 상대 경로 import 허용
    invalid
      ✔ [pages ✗ app] 상위 레이어 import 불가
      ✔ [widgets ✗ pages] 상위 레이어 import 불가
      ✔ [features ✗ widgets] 상위 레이어 import 불가
      ✔ [entities ✗ features] 상위 레이어 import 불가
      ✔ [shared ✗ entities] 상위 레이어 import 불가
      ✔ [shared ✗ app] 여러 레이어 건너뛰기 불가
      ✔ [features ✗ widgets] require 문법도 체크
      ✔ [widgets ✗ pages] dynamic import도 체크
      ✔ [entities ✗ pages] 상대 경로도 체크
  20 passing (72ms)
🔍 Node 22.x 테스트 결과
> @yh-kim/eslint-plugin-fsd@0.1.9 test
> mocha tests/**/*.js
✅ All tests passed for no-cross-layer-import rule!
  no-cross-layer-import
    valid
      ✔ [app → pages] import 허용
      ✔ [pages → widgets] import 허용
      ✔ [widgets → features] import 허용
      ✔ [features → entities] import 허용
      ✔ [entities → shared] import 허용
      ✔ [entities → entities] 같은 레이어 내 import 허용
      ✔ [pages] 외부 패키지 import 허용
      ✔ [non-FSD] FSD 레이어가 아닌 파일은 체크 안함
      ✔ [features → entities] require 문법 허용
      ✔ [features → entities] dynamic import 허용
      ✔ [features → entities] 상대 경로 import 허용
    invalid
      ✔ [pages ✗ app] 상위 레이어 import 불가
      ✔ [widgets ✗ pages] 상위 레이어 import 불가
      ✔ [features ✗ widgets] 상위 레이어 import 불가
      ✔ [entities ✗ features] 상위 레이어 import 불가
      ✔ [shared ✗ entities] 상위 레이어 import 불가
      ✔ [shared ✗ app] 여러 레이어 건너뛰기 불가
      ✔ [features ✗ widgets] require 문법도 체크
      ✔ [widgets ✗ pages] dynamic import도 체크
      ✔ [entities ✗ pages] 상대 경로도 체크
  20 passing (62ms)

@kyh0726 kyh0726 closed this Nov 28, 2025
@kyh0726 kyh0726 reopened this Nov 28, 2025
@kyh0726 kyh0726 merged commit 45e12b6 into main Nov 28, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add ESLint rule for detecting FSD cross-layer imports

1 participant