Skip to content

Commit 3ef908d

Browse files
committed
Add test for sorting shape with spread property
1 parent c30fd48 commit 3ef908d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/lib/rules/sort-prop-types.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,27 @@ ruleTester.run('sort-prop-types', rule, {
344344
}),
345345
};
346346
`
347+
}, {
348+
code: `
349+
class Component extends React.Component {
350+
render() {
351+
return <div />;
352+
}
353+
}
354+
Component.propTypes = {
355+
a: PropTypes.any,
356+
b: PropTypes.any,
357+
c: PropTypes.shape({
358+
c: PropTypes.any,
359+
...otherPropTypes,
360+
a: PropTypes.any,
361+
b: PropTypes.bool,
362+
}),
363+
};
364+
`,
365+
options: [{
366+
sortShapeProp: true
367+
}]
347368
}],
348369

349370
invalid: [{

0 commit comments

Comments
 (0)