Reports using chained assignment expressions (e.g., a = b = c).
✅ This rule is included in the ts stylistic and stylisticStrict presets.
Chained assignments can be hard to read and can lead to unexpected behavior with variable scoping and type inference.
Each assignment creates a reference to the same value, which may cause confusion when dealing with mutable values.
AEle53firsAEle53secon53firsA53 seconA5<3 sp ansty="le--0:#F78C6C;--1:#AA09">83 sp><21sp ansty="le--0:#D6DEEB;--1:#403F">521sp><3;d ivclassNa="meco">AEle53firsAEle53seconAEle53thir53firsA53 seconA53 thirA5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0getVal3 sp>53(<);d ivclassNa="meco"><);d>);d>);d>AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0proce3 sp>1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53val1(sp>7<2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0numb3 sp>1<1)sp ansty="le--0:#7FDBCA;--1:#096E">71)sp><2:sp ansty="le--0:#D6DEEB;--1:#403F">52:sp><3 sp ansty="le--0:#C5E478;--1:#3B61">B0vo3 sp>53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AEle sp>53resul {d>nt< sp ansty="le--0:#C792EA;--1:#8844">AEle sp>53cach53< sp ansty="le--0:#D6DEEB;--1:#403F">53resul sp>A53 cachA53 valuA5<3 sp ansty="le--0:#F78C6C;--1:#AA09">83 sp><22sp ansty="le--0:#D6DEEB;--1:#403F">522sp><3;d ivclassNa="meec-li">53;d><3}d ivclassNa="meco"><}d>}d>3}d> 44AE3F53fi44AE3F53sec3F53fi4<4AE= spans="tyle--0:#D6DEEB;--1:#40">34AE=>0<9821 spans="tyle--0:#D6DEEB;--1:#40">39821>3F53sec4<4AE= spans="tyle--0:#D6DEEB;--1:#40">34AE=>0<9821 spans="tyle--0:#D6DEEB;--1:#40">39821><= 1>= 1><;di vdivclass="Nameexpressive-">44AE3F53fi44AE3F53sec44AE3F53th44AEco61B0v44A61B0getV3F5<3() ;divclass="Nameec-">3F53fi4<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 va4AE=>3()>3F53sec4<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 va4AE=>3F53th4<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 va4AE=>;di><;di vdivclass="Nameexpressive-">44AEfunc361B0pro1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53v111(>6361B0nu1<111) spans="tyle--0:#7FDBCA;--1:#09">6111)>361B03F<53 {divclass="Nameec-">de44AE3F53res53 >de44AE3F53cade44AEco61B0comp44A3F53v44A0<9822 spans="tyle--0:#D6DEEB;--1:#40">39822>3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53res53 >4<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 compu4AE=>3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53ca53 >4<4AE= spans="tyle--0:#D6DEEB;--1:#40">3F53 compu4AE=>3;di>
This rule is not configurable.
If your codebase frequently uses chained assignments as a concise idiom and you find them readable, you might choose to disable this rule.
However, breaking chained assignments into separate statements generally improves code clarity and reduces potential for bugs.