prefer-named-complex-return-type
Prefer a named contract for structurally complex function return types.
Why
A large inline return annotation hides a reusable domain concept and makes signatures difficult to scan.
Fix
Name the complex nested shape while preserving its generic wrappers and type parameters; reference the named contract from the return annotation.
Examples
export function claim(): | { state: "idle" } | { state: "waiting"; retryAt: number } | { state: "claimed"; id: string } { return { state: "idle" };}type ClaimResult = | { state: "idle" } | { state: "waiting"; retryAt: number } | { state: "claimed"; id: string };export function claim(): ClaimResult { return { state: "idle" };}