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
Update: add allowElseIf option to no-else-return (fixes #9228) #9229
Update: add allowElseIf option to no-else-return (fixes #9228) #9229
Conversation
Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
@graingert, thanks for your PR! By analyzing the history of the files in this pull request, we identified @xdumaine, @not-an-aardvark and @kaicataldo to be potential reviewers. |
Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
820ec31
to
bd808ff
Compare
Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
bd808ff
to
597a960
Compare
Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
597a960
to
1625b0a
Compare
LGTM |
lib/rules/no-else-return.js
Outdated
@@ -208,15 +205,9 @@ module.exports = { | |||
return; | |||
} | |||
|
|||
for (consequents = []; node.type === "IfStatement"; node = node.alternate) { |
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.
no idea why this was added, looks like it's only there to break else if
reporting?
@platinumazure I got rid of quite a bit of code that I'm not really sure what it's for. (except to introduce the bug I reported). See #9229 (diff) |
1625b0a
to
aa92f08
Compare
LGTM |
1 similar comment
LGTM |
56a0e8a
to
a77c4eb
Compare
LGTM |
a77c4eb
to
797bd4a
Compare
LGTM |
@eslint/eslint-team Please take a look at this PR. I'm no longer sure this bugfix should actually be a default behavior change: maybe this should actually be behind an option, based on some of the changes I'm seeing in ESLint core files that became necessary as a result of the rule change (and which, IMO, became less readable as a result). Personally, I think there's an argument to be made for allowing a user to have |
Personally, I think the new behavior seems more correct. I wouldn't mind adding an option for backwards compatibility (since I suspect this pattern is fairly common), but it seems like the rule is currently not enforcing what it's supposed to enforce. |
@not-an-aardvark what's the conclusion on this? |
797bd4a
to
76f2568
Compare
LGTM |
I'm not sure -- there hasn't been any discussion about it outside of what you see on this issue. Sorry about the delay. @platinumazure Do you think we should add this to the TSC agenda so we can get it resolved? |
Yes, sorry, that would be good. I just have a feeling that the change could cause a lot of people to be confused without it being behind an option, but it shouldn't be my call. Sorry for delaying this. |
LGTM |
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.
LGTM. Thanks!
@not-an-aardvark woop! What's the next step? |
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.
LGTM, thanks very much for putting this behind an option.
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.
Thanks for working on this! Would you mind adding documentation for the new option?
I was hoping to get away without it...
Thomas Grainger
…On 29 September 2017 at 20:11, Kai Cataldo ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks for working on this! Would you mind adding documentation for the
new option?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9229 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZQTGQsQr3GdBI248OcMCDmYuLuxuvOks5snUDqgaJpZM4PL5cr>
.
|
But it's the most important part! Helps everyone know about and use your new feature :) |
ae7e209
to
8fb263d
Compare
LGTM |
8fb263d
to
9e224b7
Compare
LGTM |
9e224b7
to
ab66b89
Compare
LGTM |
ab66b89
to
7cd25c6
Compare
LGTM |
@not-an-aardvark @kaicataldo added docs |
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.
LGTM. Thanks!
@kaicataldo thanks for the review! What's the next step? |
We just did a release on Friday, so we're waiting to merge PRs until we determine whether a patch release will be necessary on Monday (see the release issue for updates). So this will probably get merged sometime around Monday, assuming no one else requests changes on it. |
No description provided.