HarperFast / HarperFast/studio

Lint rule: forbid importing other features' internals

Open
#1,496 0 comments 0 reactions 1 assignee Claimed by @kylebernhardy View on GitHub
Dominant language
TypeScript
Stars
5
Forks
4
Avg merge
1d 8h
Merged PRs (30d)
40

Description

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//` may not import from `src/features//**` 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/` 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.