-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Enable 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 |
@M-Izadmehr @bvaughn Hello all! is this still being worked on? |
Hi, everyone, is there any update about this issue ? |
Hey @bvaughn @sebmarkbage , I recently created an ES-Lint plugin (eslint-plugin-no-function-declare-after-return) to ensure there are no function declaration after return. I can :-
P.S. I added the plugin to the local fork of the repo and tested it. It was able to detect 6 places in codebase where there is a function declaration after return. |
I'm not sure what "extract logic out of the plugin" mean. Is this option just adding the |
Yup, I can just add the plugin to |
Great. Send a PR and I'll take a look :) |
Thanks @bhumijgupta |
Looking for more opportunities to contribute |
I see 452 open issues at the moment 😅 Maybe there's another one you find interesting |
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.
The text was updated successfully, but these errors were encountered: