Skip to content

unnecessaryBinds

Reports unnecessary .bind() calls.

✅ This rule is included in the ts logical presets.

Using .bind() on a function that doesn’t use this is unnecessary. Additionally, using .bind() on arrow functions has no effect since arrow functions have lexical this binding.

AEconsB0handlAE = functio11<()sp ansty="le--0:#C792EA;--1:#8844">AE< {d ivclassNa="meec-li">nt< 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">4Dhel1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3)sp ansty="le--0:#C792EA;--1:#8844">AAE<}.sp ansty="le--0:#82AAFF;--1:#3B61">B0bi5<3(sp ansty="le--0:#7FDBCA;--1:#096E">72th53<);d ivclassNa="meco"><);d>
44AEco61B0han44AE = funct11<11() spans="tyle--0:#C792EA;--1:#88">44de3F53con4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B<0log spans="tyle--0:#D6DEEB;--1:#40">31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dh1<111" spans="tyle--0:#D6DEEB;--1:#40">34<4AE ;divclass="Nameec-">4<4AE} spans="tyle--0:#D6DEEB;--1:#40">3<;}>
AEconsB0callbaAE <= sp ansty="le--0:#D6DEEB;--1:#403F">5<3(sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#C792EA;--1:#8844">AE =>< {d ivclassNa="meec-li">nt< sp ansty="le--0:#7FDBCA;--1:#096E">72thAB0proce53<()sp ansty="le--0:#C792EA;--1:#8844">AA5<3)sp ansty="le--0:#C792EA;--1:#8844">AB0bi53(context<);d ivclassNa="meco"><);d>
44AEco61B0call44A11<11() spans="tyle--0:#C792EA;--1:#88">44AE <=> {divclass="Nameec-">de6E724<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0pro3F<53() spans="tyle--0:#C792EA;--1:#88">4 ><4AE ;divclass="Nameec-">4<4AE} spans="tyle--0:#D6DEEB;--1:#40">3<;}>

This rule is not configurable.

If you use .bind() with additional arguments to create partially applied functions, this rule should not flag those cases.