Skip to content

Commit d167828

Browse files
committed
comments respect props w/ sort & added test cases
1 parent b54bfd1 commit d167828

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,14 @@ ruleTester.run('sort-prop-types', rule, {
502502
},
503503
],
504504
},
505-
semver.satisfies(eslintPkg.version, '> 3') ? {
505+
semver.satisfies(eslintPkg.version, '>= 3') ? {
506506
code: `
507507
var First = createReactClass({
508508
propTypes: {
509-
a: PropTypes.any,
510-
z: PropTypes.string
509+
/* z */
510+
z: PropTypes.string,
511+
/* a */
512+
a: PropTypes.any
511513
},
512514
render: function() {
513515
return <div />;
@@ -530,7 +532,7 @@ ruleTester.run('sort-prop-types', rule, {
530532
errors: [
531533
{
532534
messageId: 'propsNotSorted',
533-
line: 5,
535+
line: 7,
534536
column: 13,
535537
type: 'Property',
536538
},

0 commit comments

Comments
 (0)