jhusain / eslint-plugin-immutable

ESLint plugin to disable all mutation in JavaScript.
Apache License 2.0
912 stars 18 forks source link

React stateless components: propTypes conflicts with no-mutation #14

Closed scottnonnenberg closed 6 years ago

scottnonnenberg commented 8 years ago

If I write a stateless React component to prevent the no-this rule from firing, while also using the excellent eslint-plugin-react, I get warnings that I'm not defining propTypes for my method.

However, I can't fix this without also running into the no-mutation rule from this project:

HTML.propTypes = {
  body: React.PropTypes.string,
};

I'd be happy to PR a non-default .propTypes config exclusion for the no-mutation rule. Or maybe allow a generic set of strings or patterns to exclude? What do you think?

kevinSuttle commented 8 years ago

As does defaultProps.

joncursi commented 7 years ago

As does displayName