Skip to content

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

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

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:

Now loading...

🚀 Version

This rule was introduced in v6.0.0.

📚 References