Skip to content

linters/eslint-rules/prefer-noop-async

ESLint rule: prefer-noop-async

Reports await Promise.resolve() and suggests replacing it with await noopAsync() for consistency and readability.

noopAsync() from the project’s function.ts module is the conventional way to express an intentional async no-op.

Variable Description
MESSAGE_ID Message ID reported when Promise.resolve() is used for an async no-op instead of noopAsync().
preferNoopAsync ESLint rule preferring noopAsync() over Promise.resolve() for an async no-op.