Skip to content

Commit d8ccaa4

Browse files
committed
test(array-bracket-spacing): make tests more strict
1 parent cf3c4eb commit d8ccaa4

File tree

1 file changed

+110
-14
lines changed

1 file changed

+110
-14
lines changed

tests/lib/rules/array-bracket-spacing.js

Lines changed: 110 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,70 +39,166 @@ tester.run('array-bracket-spacing', rule, {
3939
{
4040
code: '<template><div :attr="[ a]" /></template>',
4141
output: '<template><div :attr="[a]" /></template>',
42-
errors: ["There should be no space after '['."]
42+
errors: [
43+
{
44+
message: "There should be no space after '['.",
45+
line: 1,
46+
column: 24,
47+
endLine: 1,
48+
endColumn: 25
49+
}
50+
]
4351
},
4452
{
4553
code: '<template><div :attr="[a ]" /></template>',
4654
output: '<template><div :attr="[a]" /></template>',
47-
errors: ["There should be no space before ']'."]
55+
errors: [
56+
{
57+
message: "There should be no space before ']'.",
58+
line: 1,
59+
column: 25,
60+
endLine: 1,
61+
endColumn: 26
62+
}
63+
]
4864
},
4965
{
5066
code: '<template><div :attr="[ a ]" /></template>',
5167
output: '<template><div :attr="[a]" /></template>',
5268
errors: [
53-
"There should be no space after '['.",
54-
"There should be no space before ']'."
69+
{
70+
message: "There should be no space after '['.",
71+
line: 1,
72+
column: 24,
73+
endLine: 1,
74+
endColumn: 25
75+
},
76+
{
77+
message: "There should be no space before ']'.",
78+
line: 1,
79+
column: 26,
80+
endLine: 1,
81+
endColumn: 27
82+
}
5583
]
5684
},
5785
{
5886
code: '<template><div :attr="[ a]" /></template>',
5987
output: '<template><div :attr="[a]" /></template>',
6088
options: ['never'],
61-
errors: ["There should be no space after '['."]
89+
errors: [
90+
{
91+
message: "There should be no space after '['.",
92+
line: 1,
93+
column: 24,
94+
endLine: 1,
95+
endColumn: 25
96+
}
97+
]
6298
},
6399
{
64100
code: '<template><div :attr="[a ]" /></template>',
65101
output: '<template><div :attr="[a]" /></template>',
66102
options: ['never'],
67-
errors: ["There should be no space before ']'."]
103+
errors: [
104+
{
105+
message: "There should be no space before ']'.",
106+
line: 1,
107+
column: 25,
108+
endLine: 1,
109+
endColumn: 26
110+
}
111+
]
68112
},
69113
{
70114
code: '<template><div :attr="[ a ]" /></template>',
71115
output: '<template><div :attr="[a]" /></template>',
72116
options: ['never'],
73117
errors: [
74-
"There should be no space after '['.",
75-
"There should be no space before ']'."
118+
{
119+
message: "There should be no space after '['.",
120+
line: 1,
121+
column: 24,
122+
endLine: 1,
123+
endColumn: 25
124+
},
125+
{
126+
message: "There should be no space before ']'.",
127+
line: 1,
128+
column: 26,
129+
endLine: 1,
130+
endColumn: 27
131+
}
76132
]
77133
},
78134
{
79135
code: '<template><div :attr="[ a]" /></template>',
80136
output: '<template><div :attr="[ a ]" /></template>',
81137
options: ['always'],
82-
errors: ["A space is required before ']'."]
138+
errors: [
139+
{
140+
message: "A space is required before ']'.",
141+
line: 1,
142+
column: 26,
143+
endLine: 1,
144+
endColumn: 27
145+
}
146+
]
83147
},
84148
{
85149
code: '<template><div :attr="[a ]" /></template>',
86150
output: '<template><div :attr="[ a ]" /></template>',
87151
options: ['always'],
88-
errors: ["A space is required after '['."]
152+
errors: [
153+
{
154+
message: "A space is required after '['.",
155+
line: 1,
156+
column: 23,
157+
endLine: 1,
158+
endColumn: 24
159+
}
160+
]
89161
},
90162
{
91163
code: '<template><div :attr="[a]" /></template>',
92164
output: '<template><div :attr="[ a ]" /></template>',
93165
options: ['always'],
94166
errors: [
95-
"A space is required after '['.",
96-
"A space is required before ']'."
167+
{
168+
message: "A space is required after '['.",
169+
line: 1,
170+
column: 23,
171+
endLine: 1,
172+
endColumn: 24
173+
},
174+
{
175+
message: "A space is required before ']'.",
176+
line: 1,
177+
column: 25,
178+
endLine: 1,
179+
endColumn: 26
180+
}
97181
]
98182
},
99183
{
100184
code: '<template><div :[[attr]]="[a]" /></template>',
101185
output: '<template><div :[[attr]]="[ a ]" /></template>',
102186
options: ['always'],
103187
errors: [
104-
"A space is required after '['.",
105-
"A space is required before ']'."
188+
{
189+
message: "A space is required after '['.",
190+
line: 1,
191+
column: 27,
192+
endLine: 1,
193+
endColumn: 28
194+
},
195+
{
196+
message: "A space is required before ']'.",
197+
line: 1,
198+
column: 29,
199+
endLine: 1,
200+
endColumn: 30
201+
}
106202
]
107203
}
108204
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy