Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEnable a lint rule not to define after return and fix existing callsites #17885
Comments
|
Hey, |
|
@M-Izadmehr This issue is all yours! We've added the "good first issue (taken)" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let us know so that we can remove the label and free it up for someone else to claim. Cheers! |
|
@M-Izadmehr Great! Thanks for taking a look. I think the first step is to look at our es-lint config and enable a canonical lint rule that already exists upstream. After that you should be able to open a PR which should fail the lint rule. After that you could do a separate commit that contains the code fixes. I wouldn't start by fixing the code though as that risks rebase issues. |
|
@sebmarkbage @bvaughn Secondly, after a small search through the project, I see that we are using this approach in at least a dozen places. I can suggest two things, if we are on the same page, then continue with the PR:
Either way, if you agree with refactoring such cases I can move on with submitting the PR. |
|
Bind |



https://twitter.com/therealyashsriv/status/1219691914523545601
We shouldn't generate code that might cause browser or linting to complain.
react/packages/legacy-events/SyntheticEvent.js
Line 259 in 0cf22a5
It's also just a confusing pattern at best.