Skip to content

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

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

This rule reports the new values of ES2018 RegExp Unicode property escape sequences which were added in ES2020.

For example, the following patterns are valid in ES2020, but syntax error in ES2019 environments:

  • \p{Script=Elym}
  • \p{Script=Elymaic}
  • \p{Script=Hmnp}
  • \p{Script=Nand}
  • \p{Script=Nandinagari}
  • \p{Script=Nyiakeng_Puachue_Hmong}
  • \p{Script=Wancho}
  • \p{Script=Wcho}

💡 Examples

⛔ Examples of incorrect code for this rule:

Now loading...

🚀 Version

This rule was introduced in v6.0.0.

📚 References