diff --git a/docs/src/_data/further_reading_links.json b/docs/src/_data/further_reading_links.json index e66ef76ce69..045bd4faf62 100644 --- a/docs/src/_data/further_reading_links.json +++ b/docs/src/_data/further_reading_links.json @@ -726,5 +726,19 @@ "logo": "https://v8.dev/favicon.ico", "title": "Faster async functions and promises · V8", "description": "Faster and easier-to-debug async functions and promises are coming to V8 v7.2 / Chrome 72." + }, + "https://github.com/tc39/proposal-regexp-v-flag": { + "domain": "github.com", + "url": "https://github.com/tc39/proposal-regexp-v-flag", + "logo": "https://github.com/fluidicon.png", + "title": "GitHub - tc39/proposal-regexp-v-flag: UTS18 set notation in regular expressions", + "description": "UTS18 set notation in regular expressions. Contribute to tc39/proposal-regexp-v-flag development by creating an account on GitHub." + }, + "https://v8.dev/features/regexp-v-flag": { + "domain": "v8.dev", + "url": "https://v8.dev/features/regexp-v-flag", + "logo": "https://v8.dev/favicon.ico", + "title": "RegExp v flag with set notation and properties of strings · V8", + "description": "The new RegExp `v` flag enables `unicodeSets` mode, unlocking support for extended character classes, including Unicode properties of strings, set notation, and improved case-insensitive matching." } } \ No newline at end of file diff --git a/docs/src/rules/require-unicode-regexp.md b/docs/src/rules/require-unicode-regexp.md index 969818e2c0d..d0069de1596 100644 --- a/docs/src/rules/require-unicode-regexp.md +++ b/docs/src/rules/require-unicode-regexp.md @@ -1,6 +1,9 @@ --- title: require-unicode-regexp rule_type: suggestion +further_reading: +- https://github.com/tc39/proposal-regexp-v-flag +- https://v8.dev/features/regexp-v-flag --- @@ -49,13 +52,11 @@ The RegExp `v` flag, introduced in ECMAScript 2024, is a superset of the `u` fla re.test('\u2028'); // → false ``` -Please see and for more details. - Therefore, the `u` and `v` flags let us work better with regular expressions. ## Rule Details -This rule aims to enforce the use of `u` flag on regular expressions. +This rule aims to enforce the use of `u` or `v` flag on regular expressions. Examples of **incorrect** code for this rule: @@ -99,4 +100,4 @@ function f(flags) { ## When Not To Use It -If you don't want to notify regular expressions with no `u` flag, then it's safe to disable this rule. +If you don't want to warn on regular expressions without either a `u` or a `v` flag, then it's safe to disable this rule.