Skip to content

es-x/no-regexp-unicode-property-escapes-2022

disallow the new values of RegExp Unicode property escape sequences in ES2022

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:

Now loading...

🚀 Version

This rule was introduced in v6.0.0.

📚 References