Reports escape backspace ([\b]) in character classes.
✅ This rule is included in the ts stylistic and stylisticStrict presets.
Reports the use of \b inside character classes to match the backspace character (U+0008).
The word boundary assertion (\b) and the escape backspace ([\b]) look identical, which can cause confusion.
Using \b inside a character class matches the backspace character, not a word boundary.
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:#F78C6C;--1:#AA09">820[sp><\bsp ansty="le--0:#82AAFF;--1:#3B61">B\bsp><0]sp ansty="le--0:#D9F5DD;--1:#1111">10]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">6111/><1B0[ spans="tyle--0:#F78C6C;--1:#AA">0982\u1B0[><0008 spans="tyle--0:#82AAFF;--1:#3B">60008><1B0] spans="tyle--0:#D9F5DD;--1:#11">11B0]><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/><8]/>8]/>
Even with other characters in the class, \b should be replaced.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B01/sp><[asp ansty="le--0:#F78C6C;--1:#AA09">82[asp><\bsp ansty="le--0:#82AAFF;--1:#3B61">B\bsp><0]sp ansty="le--0:#D9F5DD;--1:#1111">10]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/>0982\u<0008 spans="tyle--0:#82AAFF;--1:#3B">60008><1B0] spans="tyle--0:#D9F5DD;--1:#11">11B0]><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/><8]/>8]/>
The rule also checks regex patterns in RegExp constructor calls.
AEconsB0patteAE <= sp ansty="le--0:#7FDBCA;--1:#096E">72n= sp>AB0RegE5<3(sp ansty="le--0:#D9F5DD;--1:#1111">13(sp><1"sp ansty="le--0:#ECC48D;--1:#984E">41"sp>82<\\sp ansty="le--0:#ECC48D;--1:#984E">4D\\sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">531"sp><);d ivclassNa="meco"><);d>);d>);d> 44AEco61B0pat44A6E7<2new spans="tyle--0:#C792EA;--1:#88">42new><4AE spans="tyle--0:#82AAFF;--1:#3B">61B0Re4AE >31<111" spans="tyle--0:#ECC48D;--1:#98">4111">09<82\\ spans="tyle--0:#ECC48D;--1:#98">4E4Du082\\><008] spans="tyle--0:#D9F5DD;--1:#11">1008]><111" spans="tyle--0:#D6DEEB;--1:#40">3F111"><53) ;divclass="Name"><]")>]")>53)>
The word boundary assertion \b outside character classes is valid and not reported.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#C792EA;--1:#8844">AE1/sp><\bsp ansty="le--0:#5CA7E4;--1:#3A68">8Fwo\bsp>AE<\bsp ansty="le--0:#D9F5DD;--1:#1111">1\bsp><1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d>
This rule is not configurable.
If your codebase has established conventions for using [\b] and all developers working on it understand the differences, you might prefer to disable this rule.