Skip to content

stepdown

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

Why

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

Fix

Consider moving the private helper below its sole caller after reviewing initialization and reflection dependencies.

Examples

Before — flagged Do not lead with a sole-caller helper
src/run.ts
function load() {
return 1;
}
function run() {
return load();
}
After — preferred Place the caller first
src/run.ts
function run() {
return load();
}
function load() {
return 1;
}