Eslint-plugin-react: Rule to prevent `static PropTypes`

Created on 12 May 2017  路  5Comments  路  Source: yannickcr/eslint-plugin-react

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.

accepted help wanted new rule

All 5 comments

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.

We could call it no-static-typos or something

I will take a look at this.

@ljharb I think this issue should be closed.

(Fixed in #1209)

Was this page helpful?
0 / 5 - 0 ratings