Skip to content

[frontend] ESLint rules to enforce feature-sliced architecture #207

@JonnyTran

Description

@JonnyTran

Depends on

ARCHITECTURE.md issue (feature-sliced architecture).

Problem

The new architecture relies on conventions; without lint enforcement they will erode.

Rules to add

  1. Files under src/features/ may not import from src/v1/di/ or call useResolve.
  2. Files under src/features/<a>/ may not import from src/features/<b>/ (no cross-feature imports). Allowed: imports from src/shared/.
  3. Files under src/features/ may not import class entities from src/v1/domain/entities/.
  4. (Optional) Files under src/features/ must not have a sibling useXxxViewModel.ts — keep view-model logic in the component or a feature composable.

Use eslint-plugin-boundaries or eslint-plugin-import no-restricted-paths.

Acceptance criteria

  • Adding a forbidden import in a sample PR fails CI.
  • Existing /v1 and /store code is unaffected (rules scoped to src/features/).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions