Skip to content

recursionOnlyArguments

Reports function parameters that are only used in recursive calls.

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

Parameters that are only passed through to recursive calls without being used in the function body serve no functional purpose. This pattern often indicates a mistake where a parameter was intended to be used but is only being forwarded through recursive calls. Such parameters increase cognitive complexity, may impact performance, and suggest the function is only useful internally for iteration or recursion.

AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0proce1<1(sp ansty="le--1:#403F"><53sp ansty="le--0:#D7DB">E0daEB<, sp ansty="le--0:#D7DB">E0unusedPar1<1)sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AE53 (daA72leng5<3 sp ansty="le--0:#C792EA;--1:#8844">AE=<==sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#F78C6C;--1:#AA09">8<20sp ansty="le--0:#D6DEEB;--1:#403F">53)< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu5<3;d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B0proce53(daAB0sli5<3(sp ansty="le--0:#F78C6C;--1:#AA09">8<21sp ansty="le--0:#D6DEEB;--1:#403F">5<3)sp ansty="le--0:#889FB2;--1:#4D66">753 unusedParam<);d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0traver1<1(sp ansty="le--1:#403F"><53sp ansty="le--0:#D7DB">E0noEB<, sp ansty="le--0:#D7DB">E0dep1<1)sp ansty="le--0:#D6DEEB;--1:#403F">53< {d ivclassNa="meec-li">nt< sp ansty="le--0:#C792EA;--1:#8844">AE53< (sp ansty="le--0:#C792EA;--1:#8844">A53node)< {d ivclassNa="meec-li">nt < sp ansty="le--0:#C792EA;--1:#8844">AEretu5<3;d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">5<3}d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B0traver53(noA72le753 depth<);d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B0traver53(noA72rig753 depth<);d ivclassNa="meec-li">5<3}d ivclassNa="meco"><}d>AEconsB0recurAE <= sp ansty="le--0:#D9F5DD;--1:#1111">1<1(sp ansty="le--0:#D7DBE0;--1:#403F">53val1<1)sp ansty="le--0:#C792EA;--1:#8844">AE =>< {d ivclassNa="meec-li">AE< sp ansty="le--0:#C792EA;--1:#8844">AEreturB0recur53(valuAA5<3;d ivclassNa="meco"><};d>
44AEfunc361B0pro1<111( spans="tyle--0:#D7DBE0;--1:#40">3F531<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de443F53 (4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72le344A30<9820 spans="tyle--0:#D6DEEB;--1:#40">3F5<3) {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre33F<53 spans="tyle--0:#D6DEEB;--1:#40">3de61B0pro3F53(4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0s30<9821 spans="tyle--0:#D6DEEB;--1:#40">3F5<3)) ;divclass="Nameec-">3<);><}di vdivclass="Nameexpressive-">44AEfunc361B0trav1<111( spans="tyle--1:#40"><3F53 spans="tyle--0:#D7">DBE0DEDBE0d1<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de443F<53 ( spans="tyle--0:#C792EA;--1:#88">4<4AE! spans="tyle--0:#D6DEEB;--1:#40">3F53noddent< spans="tyle--0:#C792EA;--1:#88">44AEre33F<53 spans="tyle--0:#D6DEEB;--1:#40">33F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53con4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B<0log spans="tyle--0:#D6DEEB;--1:#40">3361B0Dep38<34${ spans="tyle--0:#D6DEEB;--1:#40">3F53d3<834} spans="tyle--0:#D6DEEB;--1:#40">33F<53) ;divclass="Nameec-">de61B0trav3F53(4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E726<67B, spans="tyle--0:#D6DEEB;--1:#40">3F53 de4<4AE+ spans="tyle--0:#D6DEEB;--1:#40">30<9821 spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">de61B0trav3F53(4<4AE. spans="tyle--0:#7FDBCA;--1:#09">6E72r6<67B, spans="tyle--0:#D6DEEB;--1:#40">3F53 de4<4AE+ spans="tyle--0:#D6DEEB;--1:#40">30<9821 spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">3<);><}di vdivclass="Nameexpressive-">44AEfunc361B0facto1<111( spans="tyle--0:#D7DBE0;--1:#40">31<111) spans="tyle--0:#D6DEEB;--1:#40">3F<53 {divclass="Nameec-">de443F53< (n spans="tyle--0:#C792EA;--1:#88">4430<9821 spans="tyle--0:#D6DEEB;--1:#40">3F5<3) {divclass="Nameec-">dent< spans="tyle--0:#C792EA;--1:#88">44AEre30<9821 spans="tyle--0:#D6DEEB;--1:#40">33F<53 spans="tyle--0:#D6DEEB;--1:#40">3de44AEre3F5<3 n spans="tyle--0:#C792EA;--1:#88">4<4AE* spans="tyle--0:#D6DEEB;--1:#40">361B0facto3F5<3(n spans="tyle--0:#C792EA;--1:#88">4<4AE- spans="tyle--0:#D6DEEB;--1:#40">30<9821 spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">3<);>

This rule is not configurable.

This rule might get in your way if you have functions where parameters are intentionally passed through for API consistency or future extensibility, even if they’re not currently used in the function body itself. Doing so is rare and typically indicates a design issue that should be addressed. You might consider using Flint disable comments and/or configuration file disables for those specific situations instead of completely disabling this rule.