Reports lazy quantifiers at the end of regular expressions.
✅ This rule is included in the ts logical presets.
Reports lazy quantifiers at the end of regular expressions that will never match more than their minimum.
Lazy quantifiers like *?, +?, or {n,m}? at the end of a pattern are useless because there is nothing after them to require a larger match.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>72<*?sp ansty="le--0:#D9F5DD;--1:#1111">1*?sp><1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#7FDBCA;--1:#09">6E88Fa><72*? spans="tyle--0:#5CA7E4;--1:#3A">672*?><88Fb spans="tyle--0:#D9F5DD;--1:#11">188Fb><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>?b/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>72<+?sp ansty="le--0:#D9F5DD;--1:#1111">1+?sp><1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#7FDBCA;--1:#09">6E88Fa><72+? spans="tyle--0:#5CA7E4;--1:#3A">672+?><88Fb spans="tyle--0:#D9F5DD;--1:#11">188Fb><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>?b/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>72{3,7<}?sp ansty="le--0:#D9F5DD;--1:#1111">1}?sp><1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#7FDBCA;--1:#09">6E72{388Fa><,7}? spans="tyle--0:#5CA7E4;--1:#3A">6,7}?><88Fb spans="tyle--0:#D9F5DD;--1:#11">188Fb><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>?b/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">8F(?1/sp><:asp ansty="le--0:#7FDBCA;--1:#096E">7<2|sp ansty="le--0:#5CA7E4;--1:#3A68">8F2|sp>72<+?sp ansty="le--0:#5CA7E4;--1:#3A68">8+?sp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">688F111/><(?:a spans="tyle--0:#7FDBCA;--1:#09">6(?:a>68<8Fbc spans="tyle--0:#7FDBCA;--1:#09">6E8Fbc><72+? spans="tyle--0:#5CA7E4;--1:#3A">6872+?><8F)d spans="tyle--0:#D9F5DD;--1:#11">18F)d><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/><)d/>)d/>
This rule is not configurable.
If you tend to use patterns as a partials (e.g., to combine with other patterns via string concatenation), you might need to disable this rule.