Reports negated character classes that can use shorthand escapes.
✅ This rule is included in the ts stylistic and stylisticStrict presets.
Enforces using shorthand escape sequences like \D, \W, \S, and \P instead of negated character classes.
For example, [^\d] can be written more concisely as \D.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B1/sp><0[sp ansty="le--0:#7FDBCA;--1:#096E">70[sp><2^sp ansty="le--0:#82AAFF;--1:#3B61">B0\2^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:#82AAFF;--1:#3B">61111/>1<111/ spans="tyle--0:#D6DEEB;--1:#40">3111/><\D/>\D/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B1/sp><0[sp ansty="le--0:#7FDBCA;--1:#096E">70[sp><2^sp ansty="le--0:#82AAFF;--1:#3B61">B0\2^sp>7<2+sp ansty="le--0:#D9F5DD;--1:#1111">12+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:#82AAFF;--1:#3B">61111/>61<111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B1/sp><0[sp ansty="le--0:#7FDBCA;--1:#096E">70[sp><2^sp ansty="le--0:#82AAFF;--1:#3B61">B0\2^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:#82AAFF;--1:#3B">61111/>1<111/ spans="tyle--0:#D6DEEB;--1:#40">3111/><\S/>\S/>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B1/sp><0[sp ansty="le--0:#7FDBCA;--1:#096E">70[sp><2^sp ansty="le--0:#F78C6C;--1:#AA09">822^sp><\psp ansty="le--0:#82AAFF;--1:#3B61">B0{Letter\psp><}]sp ansty="le--0:#D9F5DD;--1:#1111">1}]sp><1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>5<3;d ivclassNa="meco">3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#F78C6C;--1:#AA">09111/><82\P spans="tyle--0:#5CA7E4;--1:#3A">688F{Let82\P>1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fu spans="tyle--0:#D6DEEB;--1:#40">388Fu><}/u>}/u>
This rule is not configurable.
If you prefer the explicit negation syntax [^\d] for readability, or if your codebase has an established convention using negated character classes, you might prefer to disable this rule.