@@ -40,70 +40,166 @@ tester.run('array-bracket-newline', rule, {
40
40
{
41
41
code : '<template><div :attr="[\na]" /></template>' ,
42
42
output : '<template><div :attr="[a]" /></template>' ,
43
- errors : [ "There should be no linebreak after '['." ]
43
+ errors : [
44
+ {
45
+ message : "There should be no linebreak after '['." ,
46
+ line : 1 ,
47
+ column : 23 ,
48
+ endLine : 1 ,
49
+ endColumn : 24
50
+ }
51
+ ]
44
52
} ,
45
53
{
46
54
code : '<template><div :attr="[a\n]" /></template>' ,
47
55
output : '<template><div :attr="[a]" /></template>' ,
48
- errors : [ "There should be no linebreak before ']'." ]
56
+ errors : [
57
+ {
58
+ message : "There should be no linebreak before ']'." ,
59
+ line : 2 ,
60
+ column : 1 ,
61
+ endLine : 2 ,
62
+ endColumn : 2
63
+ }
64
+ ]
49
65
} ,
50
66
{
51
67
code : '<template><div :attr="[\na\n]" /></template>' ,
52
68
output : '<template><div :attr="[a]" /></template>' ,
53
69
errors : [
54
- "There should be no linebreak after '['." ,
55
- "There should be no linebreak before ']'."
70
+ {
71
+ message : "There should be no linebreak after '['." ,
72
+ line : 1 ,
73
+ column : 23 ,
74
+ endLine : 1 ,
75
+ endColumn : 24
76
+ } ,
77
+ {
78
+ message : "There should be no linebreak before ']'." ,
79
+ line : 3 ,
80
+ column : 1 ,
81
+ endLine : 3 ,
82
+ endColumn : 2
83
+ }
56
84
]
57
85
} ,
58
86
{
59
87
code : '<template><div :attr="[\na]" /></template>' ,
60
88
output : '<template><div :attr="[a]" /></template>' ,
61
89
options : [ 'never' ] ,
62
- errors : [ "There should be no linebreak after '['." ]
90
+ errors : [
91
+ {
92
+ message : "There should be no linebreak after '['." ,
93
+ line : 1 ,
94
+ column : 23 ,
95
+ endLine : 1 ,
96
+ endColumn : 24
97
+ }
98
+ ]
63
99
} ,
64
100
{
65
101
code : '<template><div :attr="[a\n]" /></template>' ,
66
102
output : '<template><div :attr="[a]" /></template>' ,
67
103
options : [ 'never' ] ,
68
- errors : [ "There should be no linebreak before ']'." ]
104
+ errors : [
105
+ {
106
+ message : "There should be no linebreak before ']'." ,
107
+ line : 2 ,
108
+ column : 1 ,
109
+ endLine : 2 ,
110
+ endColumn : 2
111
+ }
112
+ ]
69
113
} ,
70
114
{
71
115
code : '<template><div :attr="[\na\n]" /></template>' ,
72
116
output : '<template><div :attr="[a]" /></template>' ,
73
117
options : [ 'never' ] ,
74
118
errors : [
75
- "There should be no linebreak after '['." ,
76
- "There should be no linebreak before ']'."
119
+ {
120
+ message : "There should be no linebreak after '['." ,
121
+ line : 1 ,
122
+ column : 23 ,
123
+ endLine : 1 ,
124
+ endColumn : 24
125
+ } ,
126
+ {
127
+ message : "There should be no linebreak before ']'." ,
128
+ line : 3 ,
129
+ column : 1 ,
130
+ endLine : 3 ,
131
+ endColumn : 2
132
+ }
77
133
]
78
134
} ,
79
135
{
80
136
code : '<template><div :attr="[\na]" /></template>' ,
81
137
output : '<template><div :attr="[\na\n]" /></template>' ,
82
138
options : [ 'always' ] ,
83
- errors : [ "A linebreak is required before ']'." ]
139
+ errors : [
140
+ {
141
+ message : "A linebreak is required before ']'." ,
142
+ line : 2 ,
143
+ column : 2 ,
144
+ endLine : 2 ,
145
+ endColumn : 3
146
+ }
147
+ ]
84
148
} ,
85
149
{
86
150
code : '<template><div :attr="[a\n]" /></template>' ,
87
151
output : '<template><div :attr="[\na\n]" /></template>' ,
88
152
options : [ 'always' ] ,
89
- errors : [ "A linebreak is required after '['." ]
153
+ errors : [
154
+ {
155
+ message : "A linebreak is required after '['." ,
156
+ line : 1 ,
157
+ column : 23 ,
158
+ endLine : 1 ,
159
+ endColumn : 24
160
+ }
161
+ ]
90
162
} ,
91
163
{
92
164
code : '<template><div :attr="[a]" /></template>' ,
93
165
output : '<template><div :attr="[\na\n]" /></template>' ,
94
166
options : [ 'always' ] ,
95
167
errors : [
96
- "A linebreak is required after '['." ,
97
- "A linebreak is required before ']'."
168
+ {
169
+ message : "A linebreak is required after '['." ,
170
+ line : 1 ,
171
+ column : 23 ,
172
+ endLine : 1 ,
173
+ endColumn : 24
174
+ } ,
175
+ {
176
+ message : "A linebreak is required before ']'." ,
177
+ line : 1 ,
178
+ column : 25 ,
179
+ endLine : 1 ,
180
+ endColumn : 26
181
+ }
98
182
]
99
183
} ,
100
184
{
101
185
code : '<template><div :[[attr]]="[a]" /></template>' ,
102
186
output : '<template><div :[[attr]]="[\na\n]" /></template>' ,
103
187
options : [ 'always' ] ,
104
188
errors : [
105
- "A linebreak is required after '['." ,
106
- "A linebreak is required before ']'."
189
+ {
190
+ message : "A linebreak is required after '['." ,
191
+ line : 1 ,
192
+ column : 27 ,
193
+ endLine : 1 ,
194
+ endColumn : 28
195
+ } ,
196
+ {
197
+ message : "A linebreak is required before ']'." ,
198
+ line : 1 ,
199
+ column : 29 ,
200
+ endLine : 1 ,
201
+ endColumn : 30
202
+ }
107
203
]
108
204
}
109
205
]
0 commit comments