Skip to content

sort-prop-types with callbacksLast returns the same error multiple times #519

Closed
@trygveaa

Description

@trygveaa

When using the rule react/sort-prop-types with callbacksLast set to true, it sometimes returns the same error multiple times instead of showing different errors. For example with this code:

var Component = React.createClass({
  propTypes: {
    onChange: React.PropTypes.func,
    a: React.PropTypes.string,
    c: React.PropTypes.string,
    b: React.PropTypes.string,
  }
});

It gives this output:

  3:5  error  Callback prop types must be listed after all other prop types  react/sort-prop-types
  3:5  error  Callback prop types must be listed after all other prop types  react/sort-prop-types
  3:5  error  Callback prop types must be listed after all other prop types  react/sort-prop-types

The error for the position of onChange should only be printed once, and it should report that b or c is at the wrong position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions