Reports return statements with values inside setters.
✅ This rule is included in the ts javascript presets.
The set syntax binds an object property to a function that will be called when there is an attempt to set that property.
Setters are expected to have side effects only and not produce a return value.
Any value returned from a setter is ignored by the JavaScript engine.
This rule reports when a setter contains a return statement with a value.
AEconsB0objeAE =< {d ivclassNa="meec-li">AE< sp ansty="le--0:#C792EA;--1:#8844">AEse sp>B0val1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53v1(sp>1<1)sp ansty="le--0:#C792EA;--1:#8844">AE1)sp> {d>< {d ivclassNa="meec-li">AE < sp ansty="le--0:#C792EA;--1:#8844">AEretur sp>53vA {d>AE< sp ansty="le--0:#C792EA;--1:#8844">AE sp><},d ivclassNa="meec-li">A5},d><3;d ivclassNa="meco"><};d>};d>3;d>AEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11Examp3 sp>53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEs sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0na3 sp>1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53val1(sp>1<1)sp ansty="le--0:#D6DEEB;--1:#403F">531)sp> {d>< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu sp>53 valu {d>53< sp ansty="le--0:#D6DEEB;--1:#403F">5 sp><3}d ivclassNa="meec-li">53}d><3}d ivclassNa="meco"><}d>}d>3}d>AEcla5<3 sp ansty="le--0:#FFCB8B;--1:#1111">11Examp3 sp>53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEs sp>5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0val3 sp>1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53v1(sp>1<1)sp ansty="le--0:#D6DEEB;--1:#403F">531)sp> {d>< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AE sp>53 (vaAsp ansty="le--0:#D6DEEB;--1:#403F">5sp><3 sp ansty="le--0:#F78C6C;--1:#AA09">83 sp><20sp ansty="le--0:#D6DEEB;--1:#403F">53)20sp> {d>< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu sp>53 va {d>53 < sp ansty="le--0:#D6DEEB;--1:#403F">5 sp><3}d ivclassNa="meec-li">nt < sp ansty="le--0:#7FDBCA;--1:#096E">72th sp>A72_val5<3 sp ansty="le--0:#C792EA;--1:#8844">A3 sp>53 va3}d>53< sp ansty="le--0:#D6DEEB;--1:#403F">5 sp><3}d ivclassNa="meec-li">53}d><3}d ivclassNa="meco"> 0) { return val; } this._value = val; }"><}d>}d>3}d> 44AEco61B0ob44AE< = {divclass="Nameec-">4444AE61B0v1<111( spans="tyle--0:#D7DBE0;--1:#40">3F5111(><3val spans="tyle--0:#D9F5DD;--1:#11">13val><111) spans="tyle--0:#C792EA;--1:#88">44111)> = >dent< spans="tyle--0:#7FDBCA;--1:#09">6E72 >4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>44A3F5<3val spans="tyle--0:#C792EA;--1:#88">43val><4AE ;divclass="Nameec-">44444AE>4<4AE} spans="tyle--0:#D6DEEB;--1:#40">34AE}><,}>,}><;di vdivclass="Nameexpressive-">44AEc31111Exa3F<53 {divclass="Nameec-">de44A361B01<111( spans="tyle--0:#D7DBE0;--1:#40">3F53v111(>1<111) spans="tyle--0:#D6DEEB;--1:#40">3F111)>53 ><53 {divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E72 >4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_4AE.>34<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 va4AE=>53 >3F<53 spans="tyle--0:#D6DEEB;--1:#40">353 >3< }> }>;di><}di vdivclass="Nameexpressive-">44AEco61B0ob44AE< = {divclass="Nameec-">4444AE61B0v1<111( spans="tyle--0:#D7DBE0;--1:#40">3F5111(><3val spans="tyle--0:#D9F5DD;--1:#11">13val><111) spans="tyle--0:#C792EA;--1:#88">44111)> = >44AE< spans="tyle--0:#C792EA;--1:#88">44A >34<4AE! spans="tyle--0:#D6DEEB;--1:#40">3F534AE!>4444AE < spans="tyle--0:#C792EA;--1:#88">44AEret >44AE< spans="tyle--0:#C792EA;--1:#88">4 ><4AE }divclass="Nameec-">dent< spans="tyle--0:#7FDBCA;--1:#09">6E72 >4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72_v4AE.>44A3F5<3val spans="tyle--0:#C792EA;--1:#88">43val>4AE><4AE ;divclass="Nameec-">44444AE>4<4AE} spans="tyle--0:#D6DEEB;--1:#40">34AE}><,}>,}>}di>
This rule is not configurable.
If you are using an unusual non-standard tool that modifiers your setters at build time into standard functions, this rule may not be for you.