Skip to content

Commit ea3988f

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 e324a19 commit ea3988f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ const ignoreCaseAndCallbackLastArgs = [{
6060
callbacksLast: true,
6161
ignoreCase: true
6262
}];
63+
const reservedFirstAndCallbacksLastArgs = [{
64+
callbacksLast: true,
65+
reservedFirst: true
66+
}];
6367
const shorthandFirstArgs = [{
6468
shorthandFirst: true
6569
}];
@@ -484,6 +488,11 @@ ruleTester.run('jsx-sort-props', rule, {
484488
code: '<App key={5} />',
485489
options: reservedFirstAsInvalidArrayArgs,
486490
errors: [expectedInvalidReservedFirstError]
491+
},
492+
{
493+
code: '<App onBar z />;',
494+
options: reservedFirstAndCallbacksLastArgs,
495+
errors: [expectedCallbackError]
487496
}
488497
]
489498
});

0 commit comments

Comments
 (0)