Skip to content

TypeScript · maintainability

stepdown

eslint:stepdown

Place a private helper below its sole direct same-scope caller.

Default
error
Fix
none
Languages
typescript

Why

Caller-first ordering lets a reader follow the main flow before descending into implementation details.

Fix

Move the private helper immediately below its sole caller.

Before / after

Executed by this rule’s unit tests.

Before

Do not lead with a sole-caller helper

src/run.ts · focus
function load() { return 1; }
function run() { return load(); }

After

Place the caller first

src/run.ts · focus
function run() { return load(); }
function load() { return 1; }

Message IDs

helperAboveOnlyCaller