deslop/unused-export
Flag a named or default value export (isTypeOnly=false) that no other module in the project imports.
- Category: Dead Code
- Severity: warn
- Source:
deslop-js - Framework: global
- Enabled when: react-doctor deadCode analysis enabled (default true); whole-project scan only — skipped in --diff/--staged modes
- Documentation: https://github.com/millionco/deslop-js
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires from deslop's detectDeadExports: a value export (UnusedExport with isTypeOnly=false) whose path::name key never appears in the cross-module usage map built from every import and re-export edge in the project, and whose name isn't referenced locally or linked as the default export — so no other tracked module imports it. The finding is bare (only path, name, line, column); there is no reason, trace, or confidence to lean on, so confirm only after you yourself grep the repo and find zero importers. False positive: a public package API surface (an export named in package.json exports/main/bin, or a library entry like src/index.ts re-exporting it) that deslop's entry detection missed and thus did not treat as an entry point; a symbol consumed by an external or untracked consumer (a plugin/registry loaded by string, a test-only or generated importer outside the scanned graph); or one reached only through an export * star re-export the linker could not resolve (note the "re-export propagation skipped" failure mode) — suppress these, the export is intentionally reachable.
Fix prompt
Use this once validation confirms the diagnostic is real.
Confirm no importer exists across the repo, then drop the export keyword so the symbol becomes module-private: export function helper() becomes function helper(); if nothing in the file uses it either, delete the declaration outright. If it was only re-exported through a barrel, remove its line from the barrel too. When it is genuinely public API, leave it and instead make deslop see the entry — add the file to your package.json exports/main or an index entry so it counts as an entry point rather than dead code. See https://github.com/millionco/deslop-js