Skip to content

Commit

Permalink
prefer-starts-ends-with: Fix pipe in regex (#783)
Browse files Browse the repository at this point in the history
Co-authored-by: fisker Cheung <lionkay@gmail.com>
  • Loading branch information
Tim Allen and fisker committed Jun 24, 2020
1 parent 4594085 commit 1dca2f3
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 @@ -11,7 +11,7 @@ const doesNotContain = (string, characters) => characters.every(character => !st

const isSimpleString = string => doesNotContain(
string,
['^', '$', '+', '[', '{', '(', '\\', '.', '?', '*']
['^', '$', '+', '[', '{', '(', '\\', '.', '?', '*', '|']
);

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

const invalidRegex = [
Expand Down

0 comments on commit 1dca2f3

Please sign in to comment.