Enforces consistent Unicode escape style in regex patterns by preferring codepoint escapes.
✅ This rule is included in the ts preset.
Enforces consistent Unicode escape style in regex patterns by preferring \u{XXXX} (codepoint escape) over \uXXXX (4-digit Unicode escape) when the u or v flag is present.
The \u{...} format is more flexible, readable, and consistent with the modern Unicode handling in JavaScript.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#F78C6C;--1:#AA09">82\u001/sp><41sp ansty="le--0:#D9F5DD;--1:#1111">141sp><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\u spans="tyle--0:#7FDBCA;--1:#09">6E72{082\u><041} spans="tyle--0:#D9F5DD;--1:#11">1041}><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fu spans="tyle--0:#D6DEEB;--1:#40">388Fu><}/u>}/u>
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">82\u0041\u000[sp><42sp ansty="le--0:#82AAFF;--1:#3B61">B42sp><0]sp ansty="le--0:#D9F5DD;--1:#1111">10]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:#82AAFF;--1:#3B">6111/><1B0[ spans="tyle--0:#F78C6C;--1:#AA">091B0[><82\u spans="tyle--0:#82AAFF;--1:#3B">61B0{082\u><041} spans="tyle--0:#F78C6C;--1:#AA">09041}><82\u spans="tyle--0:#82AAFF;--1:#3B">61B0{0082\u><42}] spans="tyle--0:#D9F5DD;--1:#11">142}]><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fu spans="tyle--0:#D6DEEB;--1:#40">388Fu><]/u>]/u>
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">82\u000[sp><41sp ansty="le--0:#82AAFF;--1:#3B61">B41sp><0-sp ansty="le--0:#F78C6C;--1:#AA09">82\u000-sp><5Asp ansty="le--0:#82AAFF;--1:#3B61">B5Asp><0]sp ansty="le--0:#D9F5DD;--1:#1111">10]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:#82AAFF;--1:#3B">6111/><1B0[ spans="tyle--0:#F78C6C;--1:#AA">091B0[><82\u spans="tyle--0:#82AAFF;--1:#3B">61B0{0082\u><41}- spans="tyle--0:#F78C6C;--1:#AA">0941}-><82\u spans="tyle--0:#82AAFF;--1:#3B">61B0{0082\u><5A}] spans="tyle--0:#D9F5DD;--1:#11">15A}]><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fu spans="tyle--0:#D6DEEB;--1:#40">388Fu><]/u>]/u>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#F78C6C;--1:#AA09">82\u001/sp><41sp ansty="le--0:#D9F5DD;--1:#1111">141sp><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\u spans="tyle--0:#7FDBCA;--1:#09">6E72{082\u><041} spans="tyle--0:#D9F5DD;--1:#11">1041}><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fv spans="tyle--0:#D6DEEB;--1:#40">388Fv><}/v>}/v>
This rule is not configurable.
If you need to support environments that do not have the u or v flag, or if you intentionally use 4-digit Unicode escapes as a stylistic preference, you might want to disable this rule.
This rule is not enabled by default in Flint because the preference for \u{...} over \uXXXX is more opinionated than what most projects prefer.