Skip to content

185 symbols are exported and used only inside their own file #557

Description

@divshekhar

A dead-export audit over packages/ found three distinct groups, and only the smallest is actually dead:

signal count what to do
exported, zero references anywhere 21 delete (tracked separately)
exported, referenced only by tests 40 mostly legitimate test seams; leave
exported, referenced only inside its own file 185 drop the export, keep the code

That last group is the one worth a sweep. Nothing outside the file uses them, so the export is noise that makes the module surface look larger than it is and defeats dead-code detection for everything else — a symbol exported for no reason can never be reported as unused.

What to do

Remove the export keyword where nothing outside the file references the symbol. Mechanical, wide, and the compiler proves each one: if pnpm typecheck passes, the removal was safe.

Worth doing package by package rather than as one enormous PR — packages/core and packages/server first, since they carry the most.

Care needed: a symbol referenced only by its own .test.ts is a test seam, not dead. Those stay exported. The audit counted them separately for exactly this reason.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions