Skip to content

Commit

Permalink
[Tests] jsx-sort-propts: add test cases showing reservedFirst confl…
Browse files Browse the repository at this point in the history
…icts with callbacksLast

See #1632.
  • Loading branch information
Martin Daniel Kolpak authored and ljharb committed Feb 12, 2018
1 parent 8d8ca3f commit d6f8738
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/lib/rules/jsx-sort-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ const ignoreCaseAndCallbackLastArgs = [
ignoreCase: true,
},
];
const reservedFirstAndCallbacksLastArgs = [
{
callbacksLast: true,
reservedFirst: true,
},
];
const shorthandFirstArgs = [{ shorthandFirst: true }];
const shorthandLastArgs = [{ shorthandLast: true }];
const shorthandAndCallbackLastArgs = [
Expand Down Expand Up @@ -483,5 +489,11 @@ ruleTester.run('jsx-sort-props', rule, {
options: reservedFirstAsInvalidArrayArgs,
errors: [expectedInvalidReservedFirstError],
},
{
code: '<App onBar z />;',
output: '<App z onBar />;',
options: reservedFirstAndCallbacksLastArgs,
errors: [expectedCallbackError],
},
]),
});

0 comments on commit d6f8738

Please sign in to comment.