Skip to content

Commit d6f8738

Browse files
Martin Daniel Kolpakljharb
Martin Daniel Kolpak
authored andcommitted
[Tests] jsx-sort-propts: add test cases showing reservedFirst conflicts with callbacksLast
See #1632.
1 parent 8d8ca3f commit d6f8738

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/lib/rules/jsx-sort-props.js

+12
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ const ignoreCaseAndCallbackLastArgs = [
6262
ignoreCase: true,
6363
},
6464
];
65+
const reservedFirstAndCallbacksLastArgs = [
66+
{
67+
callbacksLast: true,
68+
reservedFirst: true,
69+
},
70+
];
6571
const shorthandFirstArgs = [{ shorthandFirst: true }];
6672
const shorthandLastArgs = [{ shorthandLast: true }];
6773
const shorthandAndCallbackLastArgs = [
@@ -483,5 +489,11 @@ ruleTester.run('jsx-sort-props', rule, {
483489
options: reservedFirstAsInvalidArrayArgs,
484490
errors: [expectedInvalidReservedFirstError],
485491
},
492+
{
493+
code: '<App onBar z />;',
494+
output: '<App z onBar />;',
495+
options: reservedFirstAndCallbacksLastArgs,
496+
errors: [expectedCallbackError],
497+
},
486498
]),
487499
});

0 commit comments

Comments
 (0)