Skip to content

Commit a4f26c1

Browse files
committed
fix
1 parent 68b761e commit a4f26c1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/rules/simplify-set-operations.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ export default createRule("simplify-set-operations", {
8282
},
8383
schema: [],
8484
messages: {
85-
doubleNegationElimination:
86-
"This character class can be double negation elimination.",
8785
toNegationOfDisjunction:
8886
"This {{target}} can be converted to the negation of a disjunction using De Morgan's laws.",
8987
toNegationOfConjunction:
@@ -105,6 +103,11 @@ export default createRule("simplify-set-operations", {
105103
): RegExpVisitor.Handlers {
106104
const { node, flags, getRegexpLocation, fixReplaceNode } =
107105
regexpContext
106+
107+
if (!flags.unicodeSets) {
108+
// set operations are exclusive to the v flag.
109+
return {}
110+
}
108111
return {
109112
onCharacterClassEnter(ccNode) {
110113
toNegationOfConjunction(ccNode)
@@ -138,7 +141,6 @@ export default createRule("simplify-set-operations", {
138141
| ClassSubtraction
139142
targetNode: CharacterClass | ExpressionCharacterClass
140143
messageId:
141-
| "doubleNegationElimination"
142144
| "toNegationOfDisjunction"
143145
| "toNegationOfConjunction"
144146
| "toSubtraction"

0 commit comments

Comments
 (0)