8000 Warn when `await` keyword might be missing · Issue #13567 · eslint/eslint · GitHub
[go: up one dir, main page]

Skip to content
Warn when await keyword might be missing #13567
@jgehrcke

Description

@jgehrcke

Picking up
babel/babel-eslint#593
and
#9787

Some of the meanest kinds of bugs we are running into are race conditions happening at runtime because of accidentally missing await statements.

Others run in this, too. Quoting @aymericbouzy:

My real pain point is the following: I have a large codebase, and when my code runs, I encounter bugs that are difficult to reproduce, unpredictable results ... simply because I forgot to await a promise. Here is a simple example where not awaiting a promise leads to bad results:

(#9787 (comment))

Now, I think we already know that ESLint cannot reliably detect these errors. I think that @ljharb is right with this statement:

This is what a type system and/or tests are for; this just isn’t a lintable problem.

But in practice I often times find myself in a situation where the type system doesn't catch the problem either or where the effort to make it detect the problem would simply be quite large.

Pragmatically, a simple warning when an await keyword might be missing would do wonders.

Then I can still decide if that's the case or not.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionfeatureThis change adds a new feature to ESLintruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0