SKY-Q410 · Quality, structure and performance
Discarded local async result
A stable local async callable is invoked as a statement whose promise is discarded. No caller awaits, returns, stores or handles that result, and the call is not explicitly marked void.
- Languages
- TypeScript, JavaScript
- Turned on by
skylos . --quality- Quality gate
- counted toward the gate limits (full and diff scans). Reported as quality; counts toward max_quality.
- Finding type
- defect
Why it matters
A caller can finish before its work completes, and a rejected promise can go unhandled. An explicit void expression records intentional background work but does not itself handle failures.
What Skylos flags
async function persist(): Promise<void> { throw new Error("disk failure");}export function save(): void { persist();}What Skylos leaves alone
async function persist(): Promise<void> { throw new Error("disk failure");}export async function save(): Promise<void> { await persist();}Why Skylos leaves it alone
Awaiting the promise propagates completion and failure to the caller.
How Skylos decides
- Runs with quality analysis on parsed JavaScript/TypeScript source. Generated or incomplete source is not used for this proof.
- Resolves a local async declaration or initialized async function, including hoisted declarations and bounded constant aliases. Parameter shadows, conflicting bindings, reassignment and possible closure writes prevent a finding.
- Reports MEDIUM only for a direct discarded expression statement, including transparent TypeScript wrappers. Awaited, returned, stored, .catch-handled and explicit void uses stay quiet.
- Does not infer external SDK return types, async generators, object methods or arbitrary promise chains. Those forms are outside this bounded local-callable check.
How to fix it
Await or return the promise, or attach a rejection handler. Use void only when the background operation is intentional.
async function persist(): Promise<void> { throw new Error("disk failure");}Removed: export function save(): void {Removed: persist();Added: export async function save(): Promise<void> {Added: await persist();}When it can be wrong
- A deliberate background call without explicit void still reports; the tool cannot infer that intent.
- Imported functions, dynamic methods and unproven return types are outside the check, so a quiet result does not verify every promise in a project.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Set
[tool.skylos] ignore = ["SKY-Q410"]to disable this rule project-wide.