Repository: ota-meshi/eslint-plugin-regexp (ts)

Issue:
`no-invisible-character`: false positive on space in `RegExp` constructor
```js
RegExp(' ') // => Unexpected invisible character. Use ' ' instead  regexp/no-invisible-character
```

Pull request:
Fix false positives for space in RegExp constructor in `regexp/no-invisible-character` rule
close #243

Patch:
diff --git a/lib/rules/no-invisible-character.ts b/lib/rules/no-invisible-character.ts
index 7f427b8..430c37b 100644
--- a/lib/rules/no-invisible-character.ts
+++ b/lib/rules/no-invisible-character.ts
@@ -68,6 +68,9 @@ export default createRule("no-invisible-character", {
 
             let index = 0
             for (const c of text) {
+                if (c === " ") {
+                    continue
+                }
                 const cp = c.codePointAt(0)!
                 if (isInvisible(cp)) {
                     const instead = toCharSetSource(cp, flags)


Test patch:
diff --git a/tests/lib/rules/no-invisible-character.ts b/tests/lib/rules/no-invisible-character.ts
index 5b625c3..161f8ec 100644
--- a/tests/lib/rules/no-invisible-character.ts
+++ b/tests/lib/rules/no-invisible-character.ts
@@ -19,6 +19,9 @@ tester.run("no-invisible-character", rule as any, {
         `
         const a = '' + '\t';
         new RegExp(a)`,
+        "new RegExp(' ')",
+        "new RegExp('a')",
+        "new RegExp('[ ]')",
     ],
     invalid: [
         {