Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prefer-starts-ends-with: Fix bug with m flag (#721)
  • Loading branch information
fisker committed May 7, 2020
1 parent 30dbe6d commit 83bbabc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rules/prefer-starts-ends-with.js
Expand Up @@ -25,7 +25,7 @@ const stringMatchSelector = [
].join('');

const checkRegex = ({pattern, flags}) => {
if (flags.includes('i')) {
if (flags.includes('i') || flags.includes('m')) {
return;
}

Expand Down
4 changes: 3 additions & 1 deletion test/prefer-starts-ends-with.js
Expand Up @@ -24,7 +24,9 @@ const validRegex = [
/^foo./,
/foo.$/,
/\^foo/,
/^foo/i
/^foo/i,
/^foo/m,
/^foo/im
];

const invalidRegex = [
Expand Down

0 comments on commit 83bbabc

Please sign in to comment.