Skip to content

Lint rule: forbid importing other features' internals #1496

Description

@kylebernhardy

Prevention follow-up to the 2026-07-13 formatBytes stage break. The setup for that break was a cross-feature reach-in: features/instance/databases/** importing from features/instance/status/analytics/** internals. When the status feature refactored its internals (as it's entitled to), the other feature broke.

Rule to enforce: code under src/features/<X>/ may not import from src/features/<Y>/** for Y ≠ X (same-feature and src/lib/src/components/src/hooks/src/integrations imports stay fine). When something is genuinely needed across features, promote it to src/lib/src/components first (see PR #1494 for the pattern).

Mechanism (verify what our oxlint version supports):

  • Preferred: oxlint no-restricted-imports with per-feature path patterns, if our version supports pattern-based restrictions (.oxlintrc.json). The local oxlint --rules output was empty in a quick check — needs a look at the docs for the pinned version.
  • Fallback: a ~20-line CI script (grep-based) in Verify PR that fails on @/features/<Y> imports outside their own feature tree — crude but sufficient and dependency-free.

Current known violations to fix or exempt when enabling: none after PR #1494 (DatabaseOverview was the only one; verify with a fresh grep when implementing).

Comment generated by kAIle (Claude Fable 5)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions