Repository: jest-community/eslint-plugin-jest (ts)

Issue:
`prefer-to-be` considers `RegExp` literal notation as a literal
The [literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#literal_notation_and_constructor) of a regular expression in JavaScript is still a `RegExp` object. But The `prefer-to-be` rule treats literal notation as a literal. So it auto-fixes `.toStrictEqual` into `.toBe`, causing tests to fail.

For example, given two tests that pass:

```ts
it('is an example', () => {
  const token: RegExp = new RegExp('[abc]+', 'gu');

  expect(token).toStrictEqual(/[abc]+/gu);
  expect(token).toStrictEqual(new RegExp('[abc]+', 'gu'));
});
```

Is changed into:

```ts
it('is an example', () => {
  const token: RegExp = new RegExp('[abc]+', 'gu');

  expect(token).toBe(/[abc]+/gu);
  expect(token).toStrictEqual(new RegExp('[abc]+', 'gu'));
});
```

And the `.toBe` test fails

Pull request description:
fix(prefer-to-be): don't consider RegExp literals as `toBe`-able
Fixes #921 

Patch:
diff --git a/src/rules/prefer-to-be.ts b/src/rules/prefer-to-be.ts
index 687d774..a67fdb5 100644
--- a/src/rules/prefer-to-be.ts
+++ b/src/rules/prefer-to-be.ts
@@ -35,8 +35,11 @@ const isFirstArgumentIdentifier = (
   name: string,
 ) => isIdentifier(getFirstArgument(matcher), name);
 
-const isPrimitiveLiteral = (matcher: ParsedEqualityMatcherCall) =>
-  getFirstArgument(matcher).type === AST_NODE_TYPES.Literal;
+const isPrimitiveLiteral = (matcher: ParsedEqualityMatcherCall): boolean => {
+  const firstArg = getFirstArgument(matcher);
+
+  return firstArg.type === AST_NODE_TYPES.Literal && !('regex' in firstArg);
+};
 
 const getFirstArgument = (matcher: ParsedEqualityMatcherCall) => {
   return followTypeAssertionChain(matcher.arguments[0]);


Test patch:
diff --git a/src/rules/__tests__/prefer-to-be.test.ts b/src/rules/__tests__/prefer-to-be.test.ts
index 2cf92e6..bd9630d 100644
--- a/src/rules/__tests__/prefer-to-be.test.ts
+++ b/src/rules/__tests__/prefer-to-be.test.ts
@@ -14,6 +14,8 @@ ruleTester.run('prefer-to-be', rule, {
     'expect(value).toMatchSnapshot();',
     "expect(catchError()).toStrictEqual({ message: 'oh noes!' })",
     'expect("something");',
+    'expect(token).toStrictEqual(/[abc]+/g);',
+    "expect(token).toStrictEqual(new RegExp('[abc]+', 'g'));",
   ],
   invalid: [
     {