Skip to content

Commit af4a9c9

Browse files
authored
fix(no-large-snapshots): avoid instanceof RegExp check for ESLint v9 compatibility (#1542)
1 parent 295120e commit af4a9c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rules/no-large-snapshots.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ const reportOnViolation = (
5454
const snapshotName = getAccessorValue(node.expression.left.property);
5555

5656
isAllowed = allowedSnapshotsInFile.some(name => {
57-
if (name instanceof RegExp) {
58-
return name.test(snapshotName);
57+
if (typeof name === 'string') {
58+
return snapshotName === name;
5959
}
6060

61-
return snapshotName === name;
61+
return name.test(snapshotName);
6262
});
6363
}
6464
}

0 commit comments

Comments
 (0)