es-x/no-regexp-unicode-property-escapes-2022
disallow the new values of RegExp Unicode property escape sequences in ES2022
- ✅ The following configurations enable this rule: no-new-in-es2022, restrict-to-es3, restrict-to-es5, restrict-to-es2015, restrict-to-es2016, restrict-to-es2017, restrict-to-es2018, restrict-to-es2019, restrict-to-es2020, and restrict-to-es2021
This rule reports the new values of ES2018 RegExp Unicode property escape sequences which were added in ES2022.
For example, the following patterns are valid in ES2022, but syntax error in ES2021 environments:
\p{Script=Cpmn}
\p{Script=Cypro_Minoan}
\p{Script=Old_Uyghur}
\p{Script=Ougr}
\p{Script=Tangsa}
\p{Script=Tnsa}
\p{Script=Toto}
\p{Script=Vith}
\p{Script=Vithkuqi}
💡 Examples
⛔ Examples of incorrect code for this rule:
🚀 Version
This rule was introduced in v6.0.0.