question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for Unicode properties `Script` values added in ES2022

See original GitHub issue

Syntax name

List new Unicode v14 Script/Script_Extensions values

Syntax proposal URL

There are no proposals. These seem to have been added due to the Unicode v14 update.

https://github.com/tc39/ecma262/pull/2515

Example code

/* eslint no-invalid-regexp : ["error"] */

// False positives
new RegExp("\\p{Script=Cpmn}", "u");
new RegExp("\\p{Script=Cypro_Minoan}", "u");
new RegExp("\\p{Script=Old_Uyghur}", "u");
new RegExp("\\p{Script=Ougr}", "u");
new RegExp("\\p{Script=Tangsa}", "u");
new RegExp("\\p{Script=Tnsa}", "u");
new RegExp("\\p{Script=Toto}", "u");
new RegExp("\\p{Script=Vith}", "u");
new RegExp("\\p{Script=Vithkuqi}", "u");

Implementation Checklist

Participation

  • I am willing to submit a pull request for this change.

Additional comments

I think that can be fixed by changing regexpp. https://github.com/mysticatea/regexpp/pull/27

ESLint has a false positive in the no-invalid-regexp rule. DEMO

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Jun 22, 2022

I don’t have any particular knowledge or preference as to other packages to use.

1reaction
mdjermanoviccommented, Apr 10, 2022

@ota-meshi thanks! Marked as accepted. It seems we’re just waiting for regexpp.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unicode property escapes - JavaScript - MDN Web Docs
Unicode property escapes Regular Expressions allows for matching characters based on their Unicode properties. A character is described by ...
Read more >
4 New JavaScript features - Exploring JS
This chapter lists what's new in ES2016–ES2022 in reverse chronological order. ... Its first widely supported property is import.meta.url which contains a ...
Read more >
ES2018: RegExp Unicode property escapes - 2ality
The proposal “RegExp Unicode Property Escapes” by Mathias Bynens is at stage 4. This blog post explains how it works.
Read more >
ECMAScript® 2023 Language Specification - TC39
Toggle shortcuts help ? Toggle "can call user code" annotations u; Navigate to/from multipage m; Jump to ...
Read more >
Unicode: flag "u" and class \p{...}
Let's look for Chinese hieroglyphs. There's a Unicode property Script (a writing system), that may have a value: Cyrillic , Greek , Arabic ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found