Dead Exports

Exported functions, constants and types that nothing imports

infoAI Qualitydead-exports

Severity depends on context. Warning when more than 20 exports are unused.

Why this matters

AI tools export everything by default. Over time, dead exports accumulate — increasing bundle size, confusing developers, and making it unclear what the public API actually is.

Example

Flagged
// lib/utils.ts
export function formatDate(d: Date) { ... }
export function formatTime(d: Date) { ... }
export function formatDateTime(d: Date) { ... }
export function capitalize(s: string) { ... }
export function slugify(s: string) { ... }
export function truncate(s: string, n: number) { ... }

// app/page.tsx
import { formatDate } from "@/lib/utils";
Fixed
// lib/utils.ts
export function formatDate(d: Date) { ... }

// app/page.tsx
import { formatDate } from "@/lib/utils";

How to fix

Delete exports nothing imports, or drop the export keyword when the function is only used inside its own file. prodlint reports once for the whole project, from five unused exports up.

Reference

In the output
Findings carry "ruleId": "dead-exports" in --json and the same id in SARIF and in the terminal.
Silence one line
// prodlint-disable-next-line dead-exports
Silence a whole file
// prodlint-disable dead-exports at the top of the file
How it works
Matches text patterns. Source on GitHub