Skip to content

asyncFunctionAwaits

Reports async functions that do not use await.

✅ This rule is included in the ts logicalStrict presets.

Functions can be marked as async to allow await expressions used inside of them. The async keyword adds a small amount of conceptual and runtime overhead. An async function without await expressions may indicate incomplete implementation or leftover code after refactoring.

This rule reports on any function that is marked as async but neither includes an await nor returns a Promise.

AEasy5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0processDa11<()sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53consoAB0l5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dprocessi1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<);d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEretu5<3 sp ansty="le--0:#F78C6C;--1:#AA09">82<42sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>AEconsB0fetchUsAE = asyn11<()sp ansty="le--0:#C792EA;--1:#8844">AE =>< {d ivclassNa="meec-li">AE< sp ansty="le--0:#C792EA;--1:#8844">AEreturn { name<: sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4DAli1<1"sp ansty="le--0:#C792EA;--1:#8844">AE <};d ivclassNa="meec-li">A5<3;d ivclassNa="meco"><};d>AEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11DataServi53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEasy5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0getDa11<()sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu5<3 sp ansty="le--0:#7FDBCA;--1:#096E">72thA11cacAB0g5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dda1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<);d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>
44AEa344AEfunc361B0fetch11<11() spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de44AEco61B0resp44AE = aw61B0f31<111" spans="tyle--0:#ECC48D;--1:#98">4E4D/api/1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">de44AEre3F53 resp4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B03F5<3() ;divclass="Nameec-">3<);><}di vdivclass="Nameexpressive-">44AEa344AEfunc361B0processI11<11() spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de44A344AEa3F<53 ( spans="tyle--0:#C792EA;--1:#88">44AEco61B04<4AE spans="tyle--0:#7FDBCA;--1:#09">6E<72of spans="tyle--0:#D6DEEB;--1:#40">3F53 asyncIterabl3F53< spans="tyle--0:#D6DEEB;--1:#40">3F53con4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B<0log spans="tyle--0:#D6DEEB;--1:#40">3F53(it3F<53 spans="tyle--0:#D6DEEB;--1:#40">33< }><}di vdivclass="Nameexpressive-">44AEa344AEfunc361B0wrapInPro11<11() spans="tyle--0:#7FDBCA;--1:#09">631111Pro361B0nu3F5<3> {divclass="Nameec-">de44AEre361B0Pro4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0res309<8242 spans="tyle--0:#D6DEEB;--1:#40">3F ><53) ;divclass="Nameec-">3<);><}di vdivclass="Nameexpressive-">44AEfunc361B0regularFunc11<11() spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de44AEre309<8242 spans="tyle--0:#D6DEEB;--1:#40">33<2;>

This rule is not configurable.

If you intentionally use async functions without await to ensure thrown errors are wrapped in rejected Promises, you may want to disable this rule. This pattern can be useful when you want consistent error handling through Promise rejection rather than thrown exceptions. You might consider using Flint disable comments and/or configuration file disables for those specific situations instead of completely disabling this rule.

Some projects that manually manage their Promises prefer to write functions that return Promises regardless of whether they’re using await. Additionally, if you are writing prototype code where many functions intentionally can be missing their implementation, this rule may get in your way.