Skip to content

Commit ed38baf

Browse files
RunDevelopmentota-meshi
authored andcommitted
Fixed type errors
1 parent fddcc80 commit ed38baf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/rules/negation.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { toCharSet } from "regexp-ast-analysis"
1+
import { toCharSet, toUnicodeSet } from "regexp-ast-analysis"
22
import type {
33
EscapeCharacterSet,
44
UnicodePropertyCharacterSet,
@@ -63,13 +63,12 @@ export default createRule("negation", {
6363
// All other character sets are either case-invariant
6464
// (/./, /\s/, /\d/) or inconsistent (/\w/).
6565

66-
// FIXME: TS Error
67-
// @ts-expect-error -- FIXME
68-
const ccSet = toCharSet(ccNode, flags)
66+
// since we know that the property doesn't contain strings,
67+
// we can just get the characters of the character class
68+
// without worrying about the strings
69+
const ccSet = toUnicodeSet(ccNode, flags).chars
6970

7071
const negatedElementSet = toCharSet(
71-
// FIXME: TS Error
72-
// @ts-expect-error -- FIXME
7372
{
7473
...element,
7574
negate: !element.negate,

0 commit comments

Comments
 (0)