Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update require-unicode-regexp.md as following up #17402 #17441

Merged
merged 3 commits into from Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/src/_data/further_reading_links.json
Expand Up @@ -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."
}
}
9 changes: 5 additions & 4 deletions 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
---


Expand Down Expand Up @@ -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 <https://github.com/tc39/proposal-regexp-v-flag> and <https://v8.dev/features/regexp-v-flag> 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:

Expand Down Expand Up @@ -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.