@@ -336,59 +336,75 @@ ruleTester.run('jsx-sort-props', rule, {
336336 {
337337 code : '<App key="key" b c="c" />' ,
338338 errors : [ expectedShorthandLastError ] ,
339- options : reservedFirstWithShorthandLast
339+ options : reservedFirstWithShorthandLast ,
340+ output : '<App key="key" c="c" b />'
340341 } ,
341342 {
342343 code : '<App ref="ref" key="key" isShorthand veryLastAttribute="yes" />' ,
343344 errors : [ expectedError , expectedShorthandLastError ] ,
344- options : reservedFirstWithShorthandLast
345+ options : reservedFirstWithShorthandLast ,
346+ output : '<App key="key" ref="ref" veryLastAttribute="yes" isShorthand />'
345347 } ,
346348 {
347349 code : '<App a z onFoo onBar />;' ,
348350 errors : [ expectedError ] ,
349- options : callbacksLastArgs
351+ options : callbacksLastArgs ,
352+ output : '<App a z onBar onFoo />;'
350353 } ,
351354 {
352355 code : '<App a onBar onFoo z />;' ,
353356 errors : [ expectedCallbackError ] ,
354- options : callbacksLastArgs
357+ options : callbacksLastArgs ,
358+ output : '<App a z onBar onFoo />;'
355359 } ,
356360 {
357361 code : '<App a="a" b />;' ,
358362 errors : [ expectedShorthandFirstError ] ,
359- options : shorthandFirstArgs
363+ options : shorthandFirstArgs ,
364+ output : '<App b a="a" />;'
360365 } ,
361366 {
362367 code : '<App z x a="a" />;' ,
363368 errors : [ expectedError ] ,
364- options : shorthandFirstArgs
369+ options : shorthandFirstArgs ,
370+ output : '<App x z a="a" />;'
365371 } ,
366372 {
367373 code : '<App b a="a" />;' ,
368374 errors : [ expectedShorthandLastError ] ,
369- options : shorthandLastArgs
375+ options : shorthandLastArgs ,
376+ output : '<App a="a" b />;'
370377 } ,
371378 {
372379 code : '<App a="a" onBar onFoo z x />;' ,
373380 errors : [ shorthandAndCallbackLastArgs ] ,
374- options : shorthandLastArgs
381+ options : shorthandLastArgs ,
382+ output : '<App a="a" onBar onFoo x z />;'
383+ } ,
384+ {
385+ code : '<App b a />;' ,
386+ errors : [ expectedError ] ,
387+ options : sortAlphabeticallyArgs ,
388+ output : '<App a b />;'
375389 } ,
376- { code : '<App b a />;' , errors : [ expectedError ] , options : sortAlphabeticallyArgs } ,
377390 // reservedFirst
378391 {
379392 code : '<App a key={1} />' ,
380393 options : reservedFirstAsBooleanArgs ,
381- errors : [ expectedReservedFirstError ]
394+ errors : [ expectedReservedFirstError ] ,
395+ output : '<App key={1} a />'
382396 } ,
383397 {
384398 code : '<div a dangerouslySetInnerHTML={{__html: "EPR"}} />' ,
385399 options : reservedFirstAsBooleanArgs ,
386- errors : [ expectedReservedFirstError ]
400+ errors : [ expectedReservedFirstError ] ,
401+ output : '<div dangerouslySetInnerHTML={{__html: "EPR"}} a />'
387402 } ,
388403 {
389404 code : '<App ref="r" key={2} b />' ,
390405 options : reservedFirstAsBooleanArgs ,
391- errors : [ expectedError ]
406+ errors : [ expectedError ] ,
407+ output : '<App key={2} ref="r" b />'
392408 } ,
393409 {
394410 code : '<App key={2} b a />' ,
@@ -411,12 +427,14 @@ ruleTester.run('jsx-sort-props', rule, {
411427 {
412428 code : '<App key={3} children={<App />} />' ,
413429 options : reservedFirstAsArrayArgs ,
414- errors : [ expectedError ]
430+ errors : [ expectedError ] ,
431+ output : '<App children={<App />} key={3} />'
415432 } ,
416433 {
417434 code : '<App z ref="r" />' ,
418435 options : reservedFirstWithNoSortAlphabeticallyArgs ,
419- errors : [ expectedReservedFirstError ]
436+ errors : [ expectedReservedFirstError ] ,
437+ output : '<App ref="r" z />'
420438 } ,
421439 {
422440 code : '<App key={4} />' ,
0 commit comments