@@ -132,65 +132,93 @@ ruleTester.run('jsx-child-element-spacing', rule, {
132
132
133
133
invalid : [ {
134
134
code : `
135
- <App>
136
- foo
137
- <a>bar</a>
138
- </App>
135
+ <App>
136
+ foo
137
+ <a>bar</a>
138
+ </App>
139
139
` ,
140
140
errors : [
141
- { message : 'Ambiguous spacing before next element a' }
141
+ {
142
+ message : 'Ambiguous spacing before next element a' ,
143
+ line : 4 ,
144
+ column : 3
145
+ }
142
146
]
143
147
} , {
144
148
code : `
145
- <App>
146
- <a>bar</a>
147
- baz
148
- </App>
149
+ <App>
150
+ <a>bar</a>
151
+ baz
152
+ </App>
149
153
` ,
150
154
errors : [
151
- { message : 'Ambiguous spacing after previous element a' }
155
+ {
156
+ message : 'Ambiguous spacing after previous element a' ,
157
+ line : 3 ,
158
+ column : 13
159
+ }
152
160
]
153
161
} , {
154
162
code : `
155
- <App>
156
- {' '}<a>bar</a>
157
- baz
158
- </App>
163
+ <App>
164
+ {' '}<a>bar</a>
165
+ baz
166
+ </App>
159
167
` ,
160
168
errors : [
161
- { message : 'Ambiguous spacing after previous element a' }
169
+ {
170
+ message : 'Ambiguous spacing after previous element a' ,
171
+ line : 3 ,
172
+ column : 18
173
+ }
162
174
]
163
175
} , {
164
176
code : `
165
- <App>
166
- Please take a look at
167
- <a href="https://js.org">this link</a>.
168
- </App>
177
+ <App>
178
+ Please take a look at
179
+ <a href="https://js.org">this link</a>.
180
+ </App>
169
181
` ,
170
182
errors : [
171
- { message : 'Ambiguous spacing before next element a' }
183
+ {
184
+ message : 'Ambiguous spacing before next element a' ,
185
+ line : 4 ,
186
+ column : 3
187
+ }
172
188
]
173
189
} , {
174
190
code : `
175
- <App>
176
- Some <code>loops</code> and some
177
- <code>if</code> statements.
178
- </App>
191
+ <App>
192
+ Some <code>loops</code> and some
193
+ <code>if</code> statements.
194
+ </App>
179
195
` ,
180
196
errors : [
181
- { message : 'Ambiguous spacing before next element code' }
197
+ {
198
+ message : 'Ambiguous spacing before next element code' ,
199
+ line : 4 ,
200
+ column : 3
201
+ }
182
202
]
183
203
} , {
184
204
code : `
185
- <App>
186
- Here is
187
- <a href="https://js.org">a link</a> and here is
188
- <a href="https://js.org">another</a>
189
- </App>
205
+ <App>
206
+ Here is
207
+ <a href="https://js.org">a link</a> and here is
208
+ <a href="https://js.org">another</a>
209
+ </App>
190
210
` ,
191
211
errors : [
192
- { message : 'Ambiguous spacing before next element a' } ,
193
- { message : 'Ambiguous spacing before next element a' }
212
+ {
213
+ message : 'Ambiguous spacing before next element a' ,
214
+ line : 4 ,
215
+ column : 3
216
+ } ,
217
+ {
218
+ message : 'Ambiguous spacing before next element a' ,
219
+ line : 5 ,
220
+ column : 3
221
+ }
194
222
]
195
223
} ]
196
224
} ) ;
0 commit comments