To support React 15.5, we need the following changes asap:
React.createClass, we also need to support an import or require of react-create-classPropTypes.* anywhere, we also need to support an import or require of prop-typesno-deprecated warn on React.createClass and React.PropTypes usage and recommends the packages as well. It should apply to all versions of React since it's safe to migrate to the standalone packages on all versions.For the third point we already have the no-deprecated rule that can be used.
I can take care of the no-unused-prop-types rule. Will look into it early next week.
After review, looks like the no-unused-prop-types and prop-types rules are not affected by the React 15.5 changes as they don't make any assumptions about where the PropTypes object comes from. No changes needed there.
In the README there's this section for the eslint config:
{
"settings": {
"react": {
"createClass": "createClass", // Regex for Component Factory to use, default to "createClass"
"pragma": "React", // Pragma to use, default to "React"
"version": "15.0" // React version, default to the latest React stable release
}
}
}
Changing "createClass": "createClass" to "createClass": "createReactClass" worked for the sort-comp rule for component detection. Haven't tested other rules...
@EvNaverniouk I think it's a flaw in the prop-types rule in particular that any validator named "shape", for example, assumes the semantics of PropTypes.shape - but you're right that that means it's not a blocker for React 15.5.
@kentor if that's the case, then perhaps we should default createClass to createReactClass when the version is 15.5+?
React 15.5.0 support seems to be complete.
createReactClass (you still got the possibility to change it to createClass using the shared settings).React.PropTypes and React.createClass were added to no-deprecated.I will publish a RC for the 7.0.0 (since there is some breaking changes here), you can test it with:
npm install eslint-plugin-react@next
Feedback welcome 馃槂
Thanks - we have more v7 PRs that need to be merged before a real v7 can go out, but as long as breaking changes can go in between RCs this is fine :-)
I'll close this for now.