Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
trygveaa opened this issue Mar 29, 2016 · 0 comments
Closed

Comments

@trygveaa
Copy link

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.

@ljharb ljharb closed this as completed in f8b4aa3 Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant