Skip to content

Commit 6608d2a

Browse files
Fixed toCharSet ignoring optional flags (#269)
1 parent 7eea638 commit 6608d2a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ function buildRegExpHelperBase({
518518
toCharSet: (node, optionFlags) => {
519519
if (optionFlags) {
520520
// Ignore the cache if the flag is specified.
521-
return toCharSet(node, flags)
521+
return toCharSet(node, optionFlags)
522522
}
523523

524524
let charSet = cacheCharSet.get(node)

tests/lib/rules/no-useless-flag.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tester.run("no-useless-flag", rule as any, {
2222
`/\\b/iu`,
2323
String.raw`/\x41/i`,
2424
`/[a-zA-Z]/i`, // in that case you should use the i flag instead of removing it
25+
`/\\p{Ll}/iu`,
2526

2627
// m
2728
`/^foo/m`,

0 commit comments

Comments
 (0)