Skip to content

Commit d8dff26

Browse files
committed
test(sort-prop-types) Add failing test for when sortShapeProp is true and shape not object literal
1 parent 5e1a64c commit d8dff26

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,24 @@ ruleTester.run('sort-prop-types', rule, {
365365
options: [{
366366
sortShapeProp: true
367367
}]
368+
}, {
369+
code: `
370+
class Component extends React.Component {
371+
render() {
372+
return <div />;
373+
}
374+
}
375+
Component.propTypes = {
376+
a: PropTypes.any,
377+
b: PropTypes.any,
378+
c: PropTypes.shape(
379+
importedPropType,
380+
),
381+
};
382+
`,
383+
options: [{
384+
sortShapeProp: true
385+
}]
368386
}],
369387

370388
invalid: [{

0 commit comments

Comments
 (0)