Skip to content

no-positional-tuple-return

Disallow returning a multi-field tuple from a named function; return a named object so call sites cannot mismatch slots.

Why

Tuple fields are identified only by position, so reordering can preserve types while changing meaning.

Fix

Return an object whose property names describe each value.

Examples

Before — flagged Do not expose positional fields
src/download.ts
export function download(): [string, number] {
return impl();
}
After — preferred Return named fields
src/download.ts
export function download(): { body: string; status: number } {
return impl();
}