@@ -16,10 +16,10 @@ description: "require simplify set operations"
16
16
17
17
## :book : Rule Details
18
18
19
- This rule aims to optimize patterns by simplifying set operations on character classes (with ` v ` flag).
19
+ This rule aims to optimize patterns by simplifying set operations in character classes (with ` v ` flag).
20
20
21
21
This rule does not report simple nested negations. (e.g. ` /[^[^abc]]/v ` )\
22
- If you want to report simple nested negations, use [ regexp/negation] rule together .
22
+ If you want to report simple nested negations, use the [ regexp/negation] rule.
23
23
24
24
<eslint-code-block fix >
25
25
@@ -48,8 +48,8 @@ This rule attempts to simplify set operations in the ways listed below:
48
48
49
49
#### De Morgan's laws
50
50
51
- This rule uses De Morgan's laws to look for patterns that can convert multiple negations into a single negation, reports on them, auto-fix them.\
52
- For example, ` /[[^a]&&[^b]]/v ` is equivalent to ` /[^ab]/v ` , ` /[[^a][^b]]/v ` is equivalent to ` /[^a&&b]/v ` .
51
+ This rule uses De Morgan's laws to look for patterns that can convert multiple negations into a single negation, reports on them, and auto-fix them.\
52
+ For example, ` /[[^a]&&[^b]]/v ` is equivalent to ` /[^ab]/v ` , and ` /[[^a][^b]]/v ` is equivalent to ` /[^a&&b]/v ` .
53
53
54
54
See < https://en.wikipedia.org/wiki/De_Morgan's_laws > .
55
55
@@ -67,7 +67,7 @@ For example, `/[a--[^b]]/v` is equivalent to `/[a&&b]/v`.
67
67
68
68
### Auto Fixes
69
69
70
- This rule's auto-fix does not remove unnecessary brackets. For example, ` /[[^a]&&[^b]]/v ` will be automatically fixed to ` /[[a][b]]/v ` .\
70
+ This rule's auto-fix does not remove unnecessary brackets. For example, ` /[[^a]&&[^b]]/v ` will be automatically fixed to ` /[^ [a][b]]/v ` .\
71
71
If you want to remove unnecessary brackets (e.g. auto-fixed to ` /[^ab]/v ` ), use [ regexp/no-useless-character-class] rule together.
72
72
73
73
## :wrench : Options
0 commit comments