Reports assigning a value with type any to variables and properties.
✅ This rule is included in the ts logical and logicalStrict presets.
The any type in TypeScript is a dangerous “escape hatch” from the type system.
Assigning an any typed value to a variable can defeat TypeScript’s type safety guarantees, allowing unexpected types to propagate through your codebase.
This rule reports assigning any to a variable, destructuring from any[], and spreading any[] into typed arrays.
It also checks generic type arguments to ensure you don’t pass an unsafe any in a generic position.
AEconsB0valAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0someFuncti= sp>53<()sp ansty="le--0:#C792EA;--1:#8844">AE a()sp>B0a5<3;d ivclassNa="meco">3;d>AEconsB0daAE <= sp ansty="le--0:#D6DEEB;--1:#403F">53Obje= sp>AB0crea5<3(sp ansty="le--0:#FF6A83;--1:#A248">48nu3(sp>53<);d ivclassNa="meco"><);d>);d>);d>AEconsB0iteAE< =sp ansty="le--0:#D6DEEB;--1:#403F">53 =sp><[]sp ansty="le--0:#C792EA;--1:#8844">AE a[]sp>B0a53[<];d ivclassNa="meco"><];d>];d>];d>AEconst< [sp ansty="le--0:#82AAFF;--1:#3B61">B0fir [sp>AE<, sp ansty="le--0:#82AAFF;--1:#3B61">B0seco, sp>AE] <= sp ansty="le--0:#82AAFF;--1:#3B61">B0getArr= sp>53<()sp ansty="le--0:#C792EA;--1:#8844">AE a()sp>B0a53[<];d ivclassNa="meco"><];d>];d>];d>AEconsB0val7<2:sp ansty="le--0:#C792EA;--1:#8844">A2:sp>11SAB0striAE> <= sp ansty="le--0:#7FDBCA;--1:#096E">72n= sp>AB0SAB0aAsp ansty="le--0:#D6DEEB;--1:#403F">53(sp><);d ivclassNa="meco"> = new Set("><);d>);d>);d>AEconsB0ite7<2:sp ansty="le--0:#C792EA;--1:#8844">A2:sp>B0stri53<[]sp ansty="le--0:#C792EA;--1:#8844">AE[]sp>< =sp ansty="le--0:#D6DEEB;--1:#403F">53 =sp>< [sp ansty="le--0:#7FDBCA;--1:#096E">72. [sp><..sp ansty="le--0:#D6DEEB;--1:#403F">5<3(sp ansty="le--0:#82AAFF;--1:#3B61">B0getIte3(sp>53(<) sp ansty="le--0:#C792EA;--1:#8844">AE) sp>5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0a3 sp>53[])<];d ivclassNa="meco"><];d>];d>];d> 44AEco61B0v64<4AE spans="tyle--0:#C5E478;--1:#3B">61B4AE ><0any spans="tyle--0:#C792EA;--1:#88">44A0any>61B0someFunc3F<53() spans="tyle--0:#C792EA;--1:#88">44AE53()>< as spans="tyle--0:#C5E478;--1:#3B">61B as ><0any spans="tyle--0:#D6DEEB;--1:#40">30any><;di vdivclass="Nameexpressive-">44AEco61B0v64<4AE spans="tyle--0:#C5E478;--1:#3B">61B0unk4AE >44A61B0someFunc3F<53() spans="tyle--0:#C792EA;--1:#88">44AE53()>< as spans="tyle--0:#C5E478;--1:#3B">61B as ><0any spans="tyle--0:#D6DEEB;--1:#40">30any>;di><;di vdivclass="Nameexpressive-">44AEco61B0i64<4AE spans="tyle--0:#C5E478;--1:#3B">61B4AE ><0any spans="tyle--0:#D6DEEB;--1:#40">3F0any><53[] spans="tyle--0:#C792EA;--1:#88">4453[]>3F5<3 [] spans="tyle--0:#C792EA;--1:#88">44AE3 []>< as spans="tyle--0:#C5E478;--1:#3B">61B as ><0any spans="tyle--0:#D6DEEB;--1:#40">3F50any><3[] ;divclass="Name">3[]>;di><;di vdivclass="Nameexpressive-">44AEco61B0v64<4AE spans="tyle--0:#FFCB8B;--1:#11">1114AE ><1Set spans="tyle--0:#C792EA;--1:#88">41Set><4AE< spans="tyle--0:#C5E478;--1:#3B">61B4AE<><0any spans="tyle--0:#C792EA;--1:#88">44AE0any><> = spans="tyle--0:#7FDBCA;--1:#09">6E7> = ><2new spans="tyle--0:#C792EA;--1:#88">42new><4AE spans="tyle--0:#82AAFF;--1:#3B">61B4AE ><0Set spans="tyle--0:#C792EA;--1:#88">40Set><4AE< spans="tyle--0:#C5E478;--1:#3B">61B4AE<><0any spans="tyle--0:#C792EA;--1:#88">40any><4AE> spans="tyle--0:#D6DEEB;--1:#40">3F54AE>><3() ;divclass="Name"> = new Set<>()>>()>3()>;di><;di vdivclass="Nameexpressive-">44AEco61B0i64<4AE spans="tyle--0:#C5E478;--1:#3B">61B0unk4AE >3F<53[] spans="tyle--0:#C792EA;--1:#88">4453[]>3F<53 [ spans="tyle--0:#7FDBCA;--1:#09">6E753 [><2... spans="tyle--0:#D6DEEB;--1:#40">32...>61B0getI3F5<3() spans="tyle--0:#C792EA;--1:#88">443() >361B<0any spans="tyle--0:#D6DEEB;--1:#40">3F53[0any><])] ;divclass="Name"><])]>])]>])]>;di>
This rule is not configurable.
If your codebase has many existing any types or areas of unsafe code, it may be difficult to enable this rule.
You might consider using lint disable comments for specific situations instead of completely disabling this rule.