Dead Exports

Exported functions that nothing imports

infoAI Qualitydead-exports

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.

Bad
// lib/utils.ts
export function formatDate(d: Date) { ... }
export function formatTime(d: Date) { ... }  // Nothing imports this
export function formatDateTime(d: Date) { ... }  // Nothing imports this
export function capitalize(s: string) { ... }  // Nothing imports this
Good
// lib/utils.ts
export function formatDate(d: Date) { ... }

// Remove or keep as non-exported if unused:
function formatTime(d: Date) { ... }

How to fix

Search for each export's usage across the project. Remove the export keyword from functions that are only used locally. Delete functions that aren't used at all.

All rules