Skip to content

anyArguments

Reports calling a function with a value typed as any as an argument.

✅ This rule is included in the ts logical and logicalStrict presets.

Passing a value typed as any as a function argument defeats TypeScript’s type safety guarantees. The any type bypasses type checking, allowing unexpected types to propagate through your codebase and potentially cause runtime errors.

This rule also detects spreading arrays or tuples with any typed elements as function arguments.

AEdeclare consB0val7<2:sp ansty="le--0:#C792EA;--1:#8844">AB0a5<3;d ivclassNa="meec-li">AEdecla5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0processStri1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53inp7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0stri1<1)sp ansty="le--0:#7FDBCA;--1:#096E">7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0vo5<3;d ivclassNa="meec-li">dB0processStri53(value<);d ivclassNa="meec-li">dAEdeclare consB0valu7<2:sp ansty="le--0:#C792EA;--1:#8844">AB0a53[<];d ivclassNa="meec-li">AEdecla5<3 sp ansty="le--0:#C792EA;--1:#8844">AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0logA1<1(sp ansty="le--0:#7FDBCA;--1:#096E">72.<..sp ansty="le--0:#D7DBE0;--1:#403F">53ite7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0stri53<[]sp ansty="le--0:#D9F5DD;--1:#1111">1<1)sp ansty="le--0:#7FDBCA;--1:#096E">7<2:sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C5E478;--1:#3B61">B0vo5<3;d ivclassNa="meec-li">dB0logA5<3(sp ansty="le--0:#7FDBCA;--1:#096E">72.<..sp ansty="le--0:#D6DEEB;--1:#403F">53values<);d ivclassNa="meco"><);d>
44AEdeclare co61B0v64<4AE spans="tyle--0:#C5E478;--1:#3B">61B0st344AEdec344AEfunc361B0processSt1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53i6361B0st1<111) spans="tyle--0:#7FDBCA;--1:#09">6361B03c61B0processSt3F53(valc44AEdeclare co61B0va64<4AE spans="tyle--0:#C5E478;--1:#3B">61B0st3F5<3[] ;divclass="Nameec-">44AEdec344AEfunc361B0lo1<111( spans="tyle--0:#7FDBCA;--1:#09">6E7<2... spans="tyle--0:#D7DBE0;--1:#40">3F53i6361B0st3F<53[] spans="tyle--0:#D9F5DD;--1:#11">1<111) spans="tyle--0:#7FDBCA;--1:#09">6361B03c61B0lo36E7<2... spans="tyle--0:#D6DEEB;--1:#40">3F53valuc6376// Passing any to unknown is all44AEdec344AEfunc361B0acceptUnk1<111( spans="tyle--0:#D7DBE0;--1:#40">3F53i6361B0unk1<111) spans="tyle--0:#7FDBCA;--1:#09">6361B0344AEdeclare co61B0unsafeV64<4AE spans="tyle--0:#C5E478;--1:#3B">61B<0any spans="tyle--0:#D6DEEB;--1:#40">361B0acceptUnk3F53(unsafeVal

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. Consider using Flint disable comments for specific situations while working to improve type safety incrementally.