目录

@typescript-eslint/return-await

Enforce consistent awaiting of returned promises.

Rule Configuration

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

Options

For details, see @typescript-eslint/return-await.

Example of Correct Code

export async function validInTryCatch1() {
  try {
    return await Promise.resolve('try');
  } catch (e) {
    return await Promise.resolve('catch');
  }
}

Example of Incorrect Code

export async function validInTryCatch1() {
  try {
    return Promise.resolve('try');
  } catch (e) {
    return Promise.resolve('catch');
  }
}

Rule Set

plugin:@typescript-eslint/all

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