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

Rule to prevent static PropTypes #1189

Closed
rsolomon opened this issue May 12, 2017 · 5 comments
Closed

Rule to prevent static PropTypes #1189

rsolomon opened this issue May 12, 2017 · 5 comments

Comments

@rsolomon
Copy link
Contributor

I've noticed this a few places, where people are recording propTypes under a static PropTypes member instead of the correct camelCase static propTypes. It would be helpful if there were a lint rule that checks for this, as using PropTypes doesn't fail, it just silently doesn't check.

@ljharb
Copy link
Member

ljharb commented May 12, 2017

That sounds like a good idea. It should probably check for any case variant of propTypes and defaultProps and contextTypes etc, and ensure that none of them exist unless they're the proper casing.

@ljharb
Copy link
Member

ljharb commented May 12, 2017

We could call it no-static-typos or something

@jseminck
Copy link
Contributor

I will take a look at this.

@DianaSuvorova
Copy link
Contributor

@ljharb I think this issue should be closed.

@ljharb
Copy link
Member

ljharb commented Aug 14, 2017

(Fixed in #1209)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants