目录

@typescript-eslint/await-thenable

The use of the await keyword is not allowed on non-Thenable values. (A Thenable value is an object that has a then method, such as a promise.)

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@typescript-eslint/await-thenable": "error"
  }
}

Options

This rule is not configurable.

Example of Correct Code

async function test() {
  await Promise.resolve('value');
}

export { test };

Example of Incorrect Code

async function test() {
  await 'value';
}

export { test };

Rule Set

plugin:@typescript-eslint/recommended
plugin:@typescript-eslint/all

For details about how to configure Code Linter check rules, see Code Linter.