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

prop-types doesn't check nextProps of componentWillReceiveProps #1651

Merged
merged 2 commits into from
Jan 21, 2018

Conversation

xjmdoo
Copy link

@xjmdoo xjmdoo commented Jan 20, 2018

Fixes #1636.

@@ -606,6 +606,10 @@ module.exports = {
type = 'destructuring';
properties = node.params[0].properties;
break;
case 'MethodDefinition':
type = 'destructuring';
properties = node.value.params[0].properties;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any chance a MethodDefinition could have a node without a value, or a node.value without a params, or a node.value.params without a 0th item?

it'd be ideal if this was more defensive (like you're already doing below), so the rule doesn't crash.

' }',
'}'
].join('\n'),
parser: 'babel-eslint',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a duplicate test that uses the default parser

@xjmdoo
Copy link
Author

xjmdoo commented Jan 21, 2018

Thanks for the review @ljharb. I've pushed a new version of the fixes.

@ljharb ljharb merged commit c558451 into jsx-eslint:master Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants