Skip to content

[FEATURE] Recreate promise-function-async #16

@portrik

Description

@portrik

What

We would like to enforce that any Promise-returning function is also defined as async. TypeScript ESLint already enforced this with promise-function-async. We could recreate a similar behavior with a custom GritQL plugin, since Biome does not support this out of the box.

Why

  1. Better stack traces
  2. Consistent code style
  3. Our internal Slack discussion that we could use this rule

Example

function suspiciouslySynchronousFunction(): Promise<number> {
    return Promise.resolve(123); // We should have an error here
}

Target Config

Only node for now. May be extended to base.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions