Skip to content

test(repo): fail on modules that no production code imports #108

Description

@lamemustafa

Problem

docs/CODE_REDUCTION_PLAN.md §1 found four modules with no production importer. Deleting them in de7551a orphaned two more that had been reachable only through them:

Reachability is a property of the import graph, not of a file, so a single-pass manual scan is invalidated by its own remediation. Both orphans kept passing tests the whole time, because the last importer standing was their own test file — a passing test proves something about a module's behaviour, never that anything calls it.

The fixed-point rule is now documented in §1, but it is not mechanised, so the next deletion will do this again.

Scope

Add a check to the existing tests/repo/ lane that walks the src import graph and fails on any module with zero src importers.

  • Roots are src/entrypoints/** plus src/extension/manifest-policy.ts, which is consumed by wxt.config.ts and so reports zero src importers while being very much alive.
  • "Only its own test imports it" must fail, not pass.
  • Any exemption belongs in an explicit allowlist that names why each entry is exempt, so the check is not quietly disabled the first time it is inconvenient.

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions