diff --git a/rules/prefer-starts-ends-with.js b/rules/prefer-starts-ends-with.js index e8ae415d54..209ba42a5e 100644 --- a/rules/prefer-starts-ends-with.js +++ b/rules/prefer-starts-ends-with.js @@ -25,7 +25,7 @@ const stringMatchSelector = [ ].join(''); const checkRegex = ({pattern, flags}) => { - if (flags.includes('i')) { + if (flags.includes('i') || flags.includes('m')) { return; } diff --git a/test/prefer-starts-ends-with.js b/test/prefer-starts-ends-with.js index 774afe1df7..5b28a1c7c3 100644 --- a/test/prefer-starts-ends-with.js +++ b/test/prefer-starts-ends-with.js @@ -24,7 +24,9 @@ const validRegex = [ /^foo./, /foo.$/, /\^foo/, - /^foo/i + /^foo/i, + /^foo/m, + /^foo/im ]; const invalidRegex = [