eslint-plugin-no-async-without-await
Usage
npm install eslint-plugin-no-async-without-await
In your .eslintrc
:
Rule Details
Examples of incorrect code for this rule:
{ return true;} async { return 2 + 2; }
Examples of correct code for this rule:
{ await ; return true;} async { await ; return 2 + 2; } { return ;}
Options
allowThrow
: Allowsthrow
to substitute forawait
. It's often convenient for anasync
function simply throw to return a rejected promise.