Add support for Unicode properties `Script` values added in ES2022
See original GitHub issueSyntax 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
- Ecma262 update: https://github.com/tc39/ecma262/pull/2515
- Acorn update: https://github.com/acornjs/acorn/pull/1084
-
espree
update: -
regexpp
update: https://github.com/mysticatea/regexpp/pull/27 -
eslint
update:
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:
- Created a year ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t have any particular knowledge or preference as to other packages to use.
@ota-meshi thanks! Marked as accepted. It seems we’re just waiting for
regexpp
.