Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 675 Bytes

ARC0010.md

File metadata and controls

26 lines (18 loc) · 675 Bytes
title ARC0010: Synchronous handler wrapped in a Promise
description Fix ARC0010 in Arc TypeScript by removing unnecessary async from command handlers that neither await work nor return asynchronous values.

What

An async command handle() has no await, for await, or returned asynchronous value. Rule: arc-core/arc0010.

Why

Arc accepts synchronous responses directly. Do not remove async mechanically when it changes an existing promise-returning contract or rejection semantics.

Bad

@command()
export class GetValue { async handle() { return 3; } }

Good

@command()
export class GetValue { handle() { return 3; } }