Skip to content

Commit eb3c724

Browse files
authored
test: fix eslint v9 testcases (#703)
1 parent 0cad3ac commit eb3c724

12 files changed

+1526
-162
lines changed

tests/lib/rules/no-contradiction-with-assertion.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
2828
errors: [
2929
{
3030
messageId: "alwaysEnterQuantifier",
31-
suggestions: [{ output: String.raw`/a\b-{1}a/` }],
31+
suggestions: [
32+
{
33+
messageId: "changeQuantifier",
34+
output: String.raw`/a\b-{1}a/`,
35+
},
36+
],
3237
},
3338
],
3439
},
@@ -46,7 +51,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
4651
errors: [
4752
{
4853
messageId: "cannotEnterQuantifier",
49-
suggestions: [{ output: String.raw`/a\b-/` }],
54+
suggestions: [
55+
{
56+
messageId: "removeQuantifier",
57+
output: String.raw`/a\b-/`,
58+
},
59+
],
5060
},
5161
],
5262
},
@@ -55,7 +65,12 @@ tester.run("no-contradiction-with-assertion", rule as any, {
5565
errors: [
5666
{
5767
messageId: "cannotEnterQuantifier",
58-
suggestions: [{ output: String.raw`/a\b-/v` }],
68+
suggestions: [
69+
{
70+
messageId: "removeQuantifier",
71+
output: String.raw`/a\b-/v`,
72+
},
73+
],
5974
},
6075
],
6176
},
@@ -67,6 +82,7 @@ tester.run("no-contradiction-with-assertion", rule as any, {
6782
messageId: "alwaysEnterQuantifier",
6883
suggestions: [
6984
{
85+
messageId: "changeQuantifier",
7086
output: String.raw`/(^[\t ]*)#(?:comments-start|cs)[\s\S]+?^[ \t]*#(?:comments-end|ce)/m`,
7187
},
7288
],

tests/lib/rules/no-control-character.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ tester.run("no-control-character", rule as any, {
5151
{
5252
messageId: "unexpected",
5353
suggestions: [
54-
{ output: String.raw`new RegExp('\x1fFOO\\0')` },
54+
{
55+
messageId: "escape",
56+
output: String.raw`new RegExp('\x1fFOO\\0')`,
57+
},
5558
],
5659
},
5760
],
@@ -80,7 +83,12 @@ tester.run("no-control-character", rule as any, {
8083
errors: [
8184
{
8285
messageId: "unexpected",
83-
suggestions: [{ output: String.raw`RegExp('\\n')` }],
86+
suggestions: [
87+
{
88+
messageId: "escape",
89+
output: String.raw`RegExp('\\n')`,
90+
},
91+
],
8492
},
8593
],
8694
},
@@ -89,7 +97,12 @@ tester.run("no-control-character", rule as any, {
8997
errors: [
9098
{
9199
messageId: "unexpected",
92-
suggestions: [{ output: String.raw`RegExp('\\n')` }],
100+
suggestions: [
101+
{
102+
messageId: "escape",
103+
output: String.raw`RegExp('\\n')`,
104+
},
105+
],
93106
},
94107
],
95108
},
@@ -98,7 +111,12 @@ tester.run("no-control-character", rule as any, {
98111
errors: [
99112
{
100113
messageId: "unexpected",
101-
suggestions: [{ output: String.raw`RegExp('\\n')` }],
114+
suggestions: [
115+
{
116+
messageId: "escape",
117+
output: String.raw`RegExp('\\n')`,
118+
},
119+
],
102120
},
103121
],
104122
},

0 commit comments

Comments
 (0)