Skip to content

Commit 83bbabc

Browse files
authored
prefer-starts-ends-with: Fix bug with m flag (#721)
1 parent 30dbe6d commit 83bbabc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

rules/prefer-starts-ends-with.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const stringMatchSelector = [
2525
].join('');
2626

2727
const checkRegex = ({pattern, flags}) => {
28-
if (flags.includes('i')) {
28+
if (flags.includes('i') || flags.includes('m')) {
2929
return;
3030
}
3131

test/prefer-starts-ends-with.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const validRegex = [
2424
/^foo./,
2525
/foo.$/,
2626
/\^foo/,
27-
/^foo/i
27+
/^foo/i,
28+
/^foo/m,
29+
/^foo/im
2830
];
2931

3032
const invalidRegex = [

0 commit comments

Comments
 (0)