mirror of
https://github.com/danbulant/oxc
synced 2026-05-21 21:29:01 +00:00
fix: remove escapes in prefer regexp test test cases (#1645)
This commit is contained in:
parent
9bea2780d9
commit
a09060be33
2 changed files with 20 additions and 88 deletions
|
|
@ -202,7 +202,7 @@ fn test() {
|
|||
r"const re = /a/; if (foo.match(re)) {}",
|
||||
r"const bar = {bar: /a/}; if (foo.match(bar.baz)) {}",
|
||||
r"if (foo.match(bar.baz())) {}",
|
||||
r#"if (foo.match(new RegExp(\"re\", \"g\"))) {}"#,
|
||||
r#"if (foo.match(new RegExp("re", "g"))) {}"#,
|
||||
r"if (foo.match(new SomeRegExp())) {}",
|
||||
r"if (foo.match(new SomeRegExp)) {}",
|
||||
r"if (foo.match(bar?.baz)) {}",
|
||||
|
|
@ -219,13 +219,13 @@ fn test() {
|
|||
r"if (foo.match(/a/y));",
|
||||
r"if (foo.match(/a/gy));",
|
||||
r"if (foo.match(/a/ig));",
|
||||
r#"if (foo.match(new RegExp(\"a\", \"g\")));"#,
|
||||
r#"if (foo.match(new RegExp("a", "g")));"#,
|
||||
r"if (/a/g.exec(foo));",
|
||||
r"if (/a/y.exec(foo));",
|
||||
r"if (/a/gy.exec(foo));",
|
||||
r"if (/a/yi.exec(foo));",
|
||||
r#"if (new RegExp(\"a\", \"g\").exec(foo));"#,
|
||||
r#"if (new RegExp(\"a\", \"y\").exec(foo));"#,
|
||||
r#"if (new RegExp("a", "g").exec(foo));"#,
|
||||
r#"if (new RegExp("a", "y").exec(foo));"#,
|
||||
r"!/a/u.exec(foo)",
|
||||
r"!/a/v.exec(foo)",
|
||||
];
|
||||
|
|
|
|||
|
|
@ -156,29 +156,12 @@ expression: prefer_regexp_test
|
|||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"re\", \"g\"))) {}
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"re\", \"g\"))) {}
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"re\", \"g\"))) {}
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"re\", \"g\"))) {}
|
||||
· ─
|
||||
1 │ if (foo.match(new RegExp("re", "g"))) {}
|
||||
· ─────
|
||||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
|
|
@ -292,29 +275,12 @@ expression: prefer_regexp_test
|
|||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"a\", \"g\")));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"a\", \"g\")));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"a\", \"g\")));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (foo.match(new RegExp(\"a\", \"g\")));
|
||||
· ─
|
||||
1 │ if (foo.match(new RegExp("a", "g")));
|
||||
· ─────
|
||||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
|
|
@ -344,53 +310,19 @@ expression: prefer_regexp_test
|
|||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"g\").exec(foo));
|
||||
· ─
|
||||
1 │ if (new RegExp("a", "g").exec(foo));
|
||||
· ────
|
||||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"g\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"g\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"g\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"y\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"y\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"y\").exec(foo));
|
||||
· ─
|
||||
╰────
|
||||
|
||||
× Invalid Unicode escape sequence
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
1 │ if (new RegExp(\"a\", \"y\").exec(foo));
|
||||
· ─
|
||||
1 │ if (new RegExp("a", "y").exec(foo));
|
||||
· ────
|
||||
╰────
|
||||
help: RegExp#test() exclusively returns a boolean and therefore is more efficient
|
||||
|
||||
⚠ eslint-plugin-unicorn(prefer-regexp-test): Prefer RegExp#test() over String#match() and RegExp#exec()
|
||||
╭─[prefer_regexp_test.tsx:1:1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue