Skip to content

Commit

Permalink
test: fix eslint v9 testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Mar 9, 2024
1 parent 0cad3ac commit b73a66b
Show file tree
Hide file tree
Showing 12 changed files with 1,526 additions and 162 deletions.
22 changes: 19 additions & 3 deletions tests/lib/rules/no-contradiction-with-assertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
errors: [
{
messageId: "alwaysEnterQuantifier",
suggestions: [{ output: String.raw`/a\b-{1}a/` }],
suggestions: [
{
messageId: "changeQuantifier",
output: String.raw`/a\b-{1}a/`,
},
],
},
],
},
Expand All @@ -46,7 +51,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
errors: [
{
messageId: "cannotEnterQuantifier",
suggestions: [{ output: String.raw`/a\b-/` }],
suggestions: [
{
messageId: "removeQuantifier",
output: String.raw`/a\b-/`,
},
],
},
],
},
Expand All @@ -55,7 +65,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
errors: [
{
messageId: "cannotEnterQuantifier",
suggestions: [{ output: String.raw`/a\b-/v` }],
suggestions: [
{
messageId: "removeQuantifier",
output: String.raw`/a\b-/v`,
},
],
},
],
},
Expand All @@ -67,6 +82,7 @@ tester.run("no-contradiction-with-assertion", rule as any, {
messageId: "alwaysEnterQuantifier",
suggestions: [
{
messageId: "changeQuantifier",
output: String.raw`/(^[\t ]*)#(?:comments-start|cs)[\s\S]+?^[ \t]*#(?:comments-end|ce)/m`,
},
],
Expand Down
26 changes: 22 additions & 4 deletions tests/lib/rules/no-control-character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ tester.run("no-control-character", rule as any, {
{
messageId: "unexpected",
suggestions: [
{ output: String.raw`new RegExp('\x1fFOO\\0')` },
{
messageId: "escape",
output: String.raw`new RegExp('\x1fFOO\\0')`,
},
],
},
],
Expand Down Expand Up @@ -80,7 +83,12 @@ tester.run("no-control-character", rule as any, {
errors: [
{
messageId: "unexpected",
suggestions: [{ output: String.raw`RegExp('\\n')` }],
suggestions: [
{
messageId: "escape",
output: String.raw`RegExp('\\n')`,
},
],
},
],
},
Expand All @@ -89,7 +97,12 @@ tester.run("no-control-character", rule as any, {
errors: [
{
messageId: "unexpected",
suggestions: [{ output: String.raw`RegExp('\\n')` }],
suggestions: [
{
messageId: "escape",
output: String.raw`RegExp('\\n')`,
},
],
},
],
},
Expand All @@ -98,7 +111,12 @@ tester.run("no-control-character", rule as any, {
errors: [
{
messageId: "unexpected",
suggestions: [{ output: String.raw`RegExp('\\n')` }],
suggestions: [
{
messageId: "escape",
output: String.raw`RegExp('\\n')`,
},
],
},
],
},
Expand Down
Loading

0 comments on commit b73a66b

Please sign in to comment.