Skip to content

sole-export-matches-filename

Make a module filename reflect its sole named public runtime export.

Why

When a module owns one runtime responsibility, matching names make that responsibility directly discoverable.

Fix

Name the module for the exported responsibility, using either the full export name or a clear leading or trailing domain phrase; otherwise colocate genuinely related exports.

Examples

Before — flagged Do not hide a sole class behind another filename
src/artifacts.ts
export class ArtifactStore {}
After — preferred Match a class and module
src/artifact-store.ts
export class ArtifactStore {}