@@ -15,8 +15,8 @@ import type { ReadonlyFlags } from "regexp-ast-analysis"
1515import {
1616 hasSomeDescendant ,
1717 toCache ,
18- toCharSet ,
1918 getFirstCharAfter ,
19+ toUnicodeSet ,
2020} from "regexp-ast-analysis"
2121
2222const UTF16_MAX = 0xffff
@@ -146,22 +146,18 @@ function isCompatibleCharLike(
146146 flags : ReadonlyFlags ,
147147 uFlags : ReadonlyFlags ,
148148) : boolean {
149- // FIXME: TS Error
150- // @ts -expect-error -- FIXME
151- const cs = toCharSet ( char , flags )
149+ const cs = toUnicodeSet ( char , flags )
152150 if ( ! cs . isDisjointWith ( SURROGATES ) ) {
153151 // If the character (class/set) contains high or low
154152 // surrogates, then we won't be able to guarantee that the
155153 // Unicode pattern will behave the same way.
156154 return false
157155 }
158156
159- // FIXME: TS Error
160- // @ts -expect-error -- FIXME
161- const uCs = toCharSet ( char , uFlags )
157+ const uCs = toUnicodeSet ( char , uFlags )
162158
163159 // Compare the ranges.
164- return rangeEqual ( cs . ranges , uCs . ranges )
160+ return rangeEqual ( cs . chars . ranges , uCs . chars . ranges )
165161}
166162
167163/**
@@ -203,23 +199,19 @@ function isCompatibleQuantifier(
203199 return undefined
204200 }
205201
206- // FIXME: TS Error
207- // @ts -expect-error -- FIXME
208- const cs = toCharSet ( q . element , flags )
202+ const cs = toUnicodeSet ( q . element , flags )
209203 if ( ! cs . isSupersetOf ( SURROGATES ) ) {
210204 // failed condition 1
211205 return false
212206 }
213207
214- // FIXME: TS Error
215- // @ts -expect-error -- FIXME
216- const uCs = toCharSet ( q . element , uFlags )
208+ const uCs = toUnicodeSet ( q . element , uFlags )
217209 if ( ! uCs . isSupersetOf ( SURROGATES ) || ! uCs . isSupersetOf ( ASTRAL ) ) {
218210 // failed condition 2
219211 return false
220212 }
221213
222- if ( ! rangeEqual ( cs . ranges , uCs . without ( ASTRAL ) . ranges ) ) {
214+ if ( ! rangeEqual ( cs . chars . ranges , uCs . without ( ASTRAL ) . chars . ranges ) ) {
223215 // failed condition 3
224216 return false
225217 }
@@ -353,7 +345,7 @@ export default createRule("require-unicode-regexp", {
353345 return { }
354346 }
355347
356- if ( ! flags . unicode ) {
348+ if ( ! flags . unicode && ! flags . unicodeSets ) {
357349 context . report ( {
358350 node,
359351 loc : getFlagsLocation ( ) ,
0 commit comments