You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# eslint-plugin-regexp
2
2
3
+
## 2.0.0-next.6
4
+
5
+
### Minor Changes
6
+
7
+
- Add support for v flag to `regexp/prefer-unicode-codepoint-escapes` rule ([#592](https://github.com/ota-meshi/eslint-plugin-regexp/pull/592))
8
+
9
+
- Add support for v flag to `regexp/unicode-escape` rule ([#592](https://github.com/ota-meshi/eslint-plugin-regexp/pull/592))
10
+
11
+
### Patch Changes
12
+
13
+
- Add support for `v` flag to `regexp/no-contradiction-with-assertion` ([#606](https://github.com/ota-meshi/eslint-plugin-regexp/pull/606))
Copy file name to clipboardExpand all lines: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -166,6 +166,7 @@ The `plugin:regexp/all` config enables all rules. It's meant for testing, not fo
166
166
|[prefer-regexp-exec](https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-regexp-exec.html)| enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided |||||
167
167
|[prefer-regexp-test](https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-regexp-test.html)| enforce that `RegExp#test` is used instead of `String#match` and `RegExp#exec`||| 🔧 ||
168
168
|[require-unicode-regexp](https://ota-meshi.github.io/eslint-plugin-regexp/rules/require-unicode-regexp.html)| enforce the use of the `u` flag ||| 🔧 ||
169
+
|[require-unicode-sets-regexp](https://ota-meshi.github.io/eslint-plugin-regexp/rules/require-unicode-sets-regexp.html)| enforce the use of the `v` flag ||| 🔧 ||
169
170
|[sort-alternatives](https://ota-meshi.github.io/eslint-plugin-regexp/rules/sort-alternatives.html)| sort alternatives if order doesn't matter ||| 🔧 ||
170
171
|[use-ignore-case](https://ota-meshi.github.io/eslint-plugin-regexp/rules/use-ignore-case.html)| use the `i` flag if it simplifies the pattern | ✅ || 🔧 ||
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
10
+
11
+
<!-- end auto-generated rule header -->
12
+
13
+
> enforce the use of the `v` flag
14
+
15
+
## :book: Rule Details
16
+
17
+
This rule reports regular expressions without the `v` flag.
18
+
19
+
It will automatically replace the `v` flag to regular expressions where it is already uses the 'u' flag and statically guaranteed to be safe to do so. In all other cases, the developer has to check that adding the `v` flag doesn't cause the regex to behave incorrectly.
20
+
21
+
If you want to automatically add the `v` flag to legacy regular expressions that don't use the `u` flag, use them together with the [regexp/require-unicode-regexp] rule.
Copy file name to clipboardExpand all lines: docs/rules/sort-alternatives.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,8 @@ This rule will sort alternatives to improve readability and maintainability.
19
19
20
20
The primary target of this rule are lists of words and/or numbers. These lists are somewhat common, and sorting them makes it easy for readers to check whether a particular word or number is included.
21
21
22
-
This rule will only sort alternatives if reordering the alternatives doesn't affect the pattern.
22
+
This rule will only sort alternatives if reordering the alternatives doesn't affect the pattern.\
23
+
However, character classes containing strings are ensured to match the longest string, so they can always be sorted.
23
24
24
25
<eslint-code-blockfix>
25
26
@@ -29,11 +30,13 @@ This rule will only sort alternatives if reordering the alternatives doesn't aff
0 commit comments