es-x/no-regexp-unicode-property-escapes-2021
disallow the new values of RegExp Unicode property escape sequences in ES2021
- ✅ The following configurations enable this rule: no-new-in-es2021, restrict-to-es3, restrict-to-es5, restrict-to-es2015, restrict-to-es2016, restrict-to-es2017, restrict-to-es2018, restrict-to-es2019, and restrict-to-es2020
This rule reports the new values of ES2018 RegExp Unicode property escape sequences which were added in ES2021.
For example, the following patterns are valid in ES2021, but syntax error in ES2020 environments:
\p{EBase}
\p{EComp}
\p{EMod}
\p{EPres}
\p{ExtPict}
\p{Script=Chorasmian}
\p{Script=Chrs}
\p{Script=Diak}
\p{Script=Dives_Akuru}
\p{Script=Khitan_Small_Script}
\p{Script=Kits}
\p{Script=Yezi}
\p{Script=Yezidi}
💡 Examples
⛔ Examples of incorrect code for this rule:
🚀 Version
This rule was introduced in v6.0.0.