@@ -166,69 +166,56 @@ ruleTester.run('jsx-sort-props', rule, {
166
166
invalid : [
167
167
{
168
168
code : '<App b a />;' ,
169
- errors : [ expectedError ] ,
170
- output : '<App a b />;'
169
+ errors : [ expectedError ]
171
170
} ,
172
171
{
173
172
code : '<App aB a />;' ,
174
- errors : [ expectedError ] ,
175
- output : '<App a aB />;'
173
+ errors : [ expectedError ]
176
174
} ,
177
175
{
178
176
code : '<App A a />;' ,
179
- errors : [ expectedError ] ,
180
- output : '<App a A />;'
177
+ errors : [ expectedError ]
181
178
} ,
182
179
{
183
180
code : '<App aB aA />;' ,
184
- errors : [ expectedError ] ,
185
- output : '<App aA aB />;'
181
+ errors : [ expectedError ]
186
182
} ,
187
183
{
188
184
code : '<App aaB aA />;' ,
189
- errors : [ expectedError ] ,
190
- output : '<App aA aaB />;'
185
+ errors : [ expectedError ]
191
186
} ,
192
187
{
193
188
code : '<App aaB aaa aA a />;' ,
194
- errors : [ expectedError , expectedError , expectedError ] ,
195
- output : '<App a aA aaa aaB />;'
189
+ errors : [ expectedError , expectedError , expectedError ]
196
190
} ,
197
191
{
198
192
code : '<App {...this.props} b a />;' ,
199
- errors : [ expectedError ] ,
200
- output : '<App {...this.props} a b />;'
193
+ errors : [ expectedError ]
201
194
} ,
202
195
{
203
196
code : '<App c {...this.props} b a />;' ,
204
- errors : [ expectedError ] ,
205
- output : '<App c {...this.props} a b />;'
197
+ errors : [ expectedError ]
206
198
} ,
207
199
{
208
200
code : '<App B a />;' ,
209
201
options : ignoreCaseArgs ,
210
- errors : [ expectedError ] ,
211
- output : '<App a B />;'
202
+ errors : [ expectedError ]
212
203
} ,
213
204
{
214
205
code : '<App B A c />;' ,
215
206
options : ignoreCaseArgs ,
216
- errors : [ expectedError ] ,
217
- output : '<App A B c />;'
207
+ errors : [ expectedError ]
218
208
} ,
219
209
{
220
210
code : '<App c="a" a="c" b="b" />;' ,
221
- output : '<App a="c" b="b" c="a" />;' ,
222
211
errors : 2
223
212
} ,
224
213
{
225
214
code : '<App {...this.props} c="a" a="c" b="b" />;' ,
226
- output : '<App {...this.props} a="c" b="b" c="a" />;' ,
227
215
errors : 2
228
216
} ,
229
217
{
230
218
code : '<App d="d" b="b" {...this.props} c="a" a="c" />;' ,
231
- output : '<App b="b" d="d" {...this.props} a="c" c="a" />;' ,
232
219
errors : 2
233
220
} ,
234
221
{
@@ -245,26 +232,11 @@ ruleTester.run('jsx-sort-props', rule, {
245
232
>
246
233
{test}
247
234
</App>
248
- ` ,
249
- output : `
250
- <App
251
- _onClick={function(){}}
252
- a={true}
253
- onHandle={function(){}}
254
- r
255
- z
256
- {...this.props}
257
- b={false}
258
- {...otherProps}
259
- >
260
- {test}
261
- </App>
262
235
` ,
263
236
errors : 3
264
237
} ,
265
238
{
266
239
code : '<App b={2} c={3} d={4} e={5} f={6} g={7} h={8} i={9} j={10} k={11} a={1} />' ,
267
- output : '<App a={1} b={2} c={3} d={4} e={5} f={6} g={7} h={8} i={9} j={10} k={11} />' ,
268
240
errors : 1
269
241
} ,
270
242
{
@@ -283,21 +255,6 @@ ruleTester.run('jsx-sort-props', rule, {
283
255
onKeyboardChoiceHovered={onKeyboardChoiceHovered}
284
256
keyboardShortcutType
285
257
/>` ,
286
- output : `<List
287
- allowMultipleSelection={allowMultipleSelection}
288
- className={className}
289
- direction={direction}
290
- handleAppScroll={handleAppScroll}
291
- isActive={isActive}
292
- isFocused={isFocused}
293
- keyboardShortcutType
294
- layoutItemsSize={layoutItemsSize}
295
- measureLongestChildNode={measureLongestChildNode}
296
- onCommitAnswer={onCommitAnswer}
297
- onKeyboardChoiceHovered={onKeyboardChoiceHovered}
298
- onStageAnswer={onStageAnswer}
299
- resetSelection={resetSelection}
300
- />` ,
301
258
errors : 10
302
259
} ,
303
260
{
@@ -328,137 +285,93 @@ ruleTester.run('jsx-sort-props', rule, {
328
285
validation={validation}
329
286
onSubmit={onSubmit}
330
287
/>` ,
331
- output : `<CreateNewJob
332
- campaign='Some Campaign name'
333
- campaignFinish={moment('2018-09-01 00:00:00')}
334
- campaignStart={moment('2018-07-28 00:00:00')}
335
- closed={false}
336
- description='Some description for this job'
337
- flag='1'
338
- flagOptions={flagOptions}
339
- jobHeight={300}
340
- jobNumber={'Job Number can be a String'}
341
- jobTemplate='1'
342
- jobTemplateOptions={jobTemplateOptions}
343
- jobWidth={200}
344
- numberOfPages={30}
345
- onChange={onChange}
346
- onClose={onClose}
347
- onSubmit={onSubmit}
348
- spreadSheetTemplate='1'
349
-
350
- spreadSheetTemplateOptions={spreadSheetTemplateOptions}
351
- stateMachine='1'
352
- stateMachineOptions={stateMachineOptions}
353
- validation={validation}
354
- workflowTemplate='1'
355
- workflowTemplateOptions={workflowTemplateOptions}
356
- workflowTemplateSteps={workflowTemplateSteps}
357
- />` ,
358
288
errors : 13
359
289
} ,
360
290
{
361
291
code : '<App key="key" b c="c" />' ,
362
292
errors : [ expectedShorthandLastError ] ,
363
- options : reservedFirstWithShorthandLast ,
364
- output : '<App key="key" c="c" b />'
293
+ options : reservedFirstWithShorthandLast
365
294
} ,
366
295
{
367
296
code : '<App ref="ref" key="key" isShorthand veryLastAttribute="yes" />' ,
368
297
errors : [ expectedError , expectedShorthandLastError ] ,
369
- options : reservedFirstWithShorthandLast ,
370
- output : '<App key="key" ref="ref" veryLastAttribute="yes" isShorthand />'
298
+ options : reservedFirstWithShorthandLast
371
299
} ,
372
300
{
373
301
code : '<App a z onFoo onBar />;' ,
374
302
errors : [ expectedError ] ,
375
- options : callbacksLastArgs ,
376
- output : '<App a z onBar onFoo />;'
303
+ options : callbacksLastArgs
377
304
} ,
378
305
{
379
306
code : '<App a onBar onFoo z />;' ,
380
307
errors : [ expectedCallbackError ] ,
381
- options : callbacksLastArgs ,
382
- output : '<App a z onBar onFoo />;'
308
+ options : callbacksLastArgs
383
309
} ,
384
310
{
385
311
code : '<App a="a" b />;' ,
386
312
errors : [ expectedShorthandFirstError ] ,
387
- options : shorthandFirstArgs ,
388
- output : '<App b a="a" />;'
313
+ options : shorthandFirstArgs
389
314
} ,
390
315
{
391
316
code : '<App z x a="a" />;' ,
392
317
errors : [ expectedError ] ,
393
- options : shorthandFirstArgs ,
394
- output : '<App x z a="a" />;'
318
+ options : shorthandFirstArgs
395
319
} ,
396
320
{
397
321
code : '<App b a="a" />;' ,
398
322
errors : [ expectedShorthandLastError ] ,
399
- options : shorthandLastArgs ,
400
- output : '<App a="a" b />;'
323
+ options : shorthandLastArgs
401
324
} ,
402
325
{
403
326
code : '<App a="a" onBar onFoo z x />;' ,
404
327
errors : [ shorthandAndCallbackLastArgs ] ,
405
- options : shorthandLastArgs ,
406
- output : '<App a="a" onBar onFoo x z />;'
328
+ options : shorthandLastArgs
407
329
} ,
408
330
{
409
331
code : '<App b a />;' ,
410
332
errors : [ expectedError ] ,
411
- options : sortAlphabeticallyArgs ,
412
- output : '<App a b />;'
333
+ options : sortAlphabeticallyArgs
413
334
} ,
414
335
// reservedFirst
415
336
{
416
337
code : '<App a key={1} />' ,
417
338
options : reservedFirstAsBooleanArgs ,
418
- errors : [ expectedReservedFirstError ] ,
419
- output : '<App key={1} a />'
339
+ errors : [ expectedReservedFirstError ]
420
340
} ,
421
341
{
422
342
code : '<div a dangerouslySetInnerHTML={{__html: "EPR"}} />' ,
423
343
options : reservedFirstAsBooleanArgs ,
424
- errors : [ expectedReservedFirstError ] ,
425
- output : '<div dangerouslySetInnerHTML={{__html: "EPR"}} a />'
344
+ errors : [ expectedReservedFirstError ]
426
345
} ,
427
346
{
428
347
code : '<App ref="r" key={2} b />' ,
429
348
options : reservedFirstAsBooleanArgs ,
430
- errors : [ expectedError ] ,
431
- output : '<App key={2} ref="r" b />'
349
+ errors : [ expectedError ]
432
350
} ,
433
351
{
434
352
code : '<App key={2} b a />' ,
435
353
options : reservedFirstAsBooleanArgs ,
436
- output : '<App key={2} a b />' ,
437
354
errors : [ expectedError ]
438
355
} ,
439
356
{
440
357
code : '<App b a />' ,
441
358
options : reservedFirstAsBooleanArgs ,
442
- output : '<App a b />' ,
443
359
errors : [ expectedError ]
444
360
} ,
445
361
{
446
362
code : '<App dangerouslySetInnerHTML={{__html: "EPR"}} e key={2} b />' ,
447
363
options : reservedFirstAsBooleanArgs ,
448
- output : '<App key={2} b dangerouslySetInnerHTML={{__html: "EPR"}} e />' ,
449
364
errors : [ expectedReservedFirstError , expectedError ]
450
365
} ,
451
366
{
452
367
code : '<App key={3} children={<App />} />' ,
453
368
options : reservedFirstAsArrayArgs ,
454
- errors : [ expectedError ] ,
455
- output : '<App children={<App />} key={3} />'
369
+ errors : [ expectedError ]
456
370
} ,
457
371
{
458
372
code : '<App z ref="r" />' ,
459
373
options : reservedFirstWithNoSortAlphabeticallyArgs ,
460
- errors : [ expectedReservedFirstError ] ,
461
- output : '<App ref="r" z />'
374
+ errors : [ expectedReservedFirstError ]
462
375
} ,
463
376
{
464
377
code : '<App key={4} />' ,
0 commit comments