[eslint] strip tailing property in assignments#16784
[eslint] strip tailing property in assignments#16784gaearon merged 2 commits intofacebook:masterfrom
Conversation
Details of bundled changes.Comparing: 45b6443...5ded688 eslint-plugin-react-hooks
|
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
|
Can you please rebase? We moved to the suggestions API so the test needs tweaks. |
|
👌 I'll try this weekend. |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2381833:
|
|
Moved to the suggestions API. PTAL |
There was a problem hiding this comment.
What makes you think it's an assignment in this branch? Can we make it more specific and throw on something unexpected?
There was a problem hiding this comment.
😅 tryStrippingTrailingPropsInAssigment could have been a better choice. I'm trying to enumerate all cases and confused by a test:
function MyComponent(props) {
useEffect(() => {
if (props.foo.onChange) {
props.foo.onChange();
}
}, []);
}Why is props.foo a proper dependency? Why not props.foo.onChange?
There was a problem hiding this comment.
Just inline in this function into the parent one.
|
Thanks. |
closes #15510