-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Account for UNSAFE_ method in no-will-update-set-state #1845
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
Account for UNSAFE_ method in no-will-update-set-state #1845
Conversation
3cb8d0d
to
40c4ffa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide test cases for all kinds of components that use the default parser?
lib/util/makeNoMethodSetStateRule.js
Outdated
@@ -28,6 +28,15 @@ function makeNoMethodSetStateRule(methodName) { | |||
create: function(context) { | |||
const mode = context.options[0] || 'allow-in-func'; | |||
|
|||
function nameMatches(name) { | |||
let matches = name === methodName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it could return immediately if true, cleaning up the rest of the function
40c4ffa
to
8122c8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and made these changes, so as to merge this more quickly.
Ah, thanks! |
Resolves #1844