Skip to content
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

Merged
merged 8 commits into from Oct 2, 2017

Conversation

graingert
Copy link
Contributor

No description provided.

@eslintbot
Copy link

Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@mention-bot
Copy link

@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.

@eslintbot
Copy link

Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

Thanks for the pull request, @graingert! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

LGTM

@@ -208,15 +205,9 @@ module.exports = {
return;
}

for (consequents = []; node.type === "IfStatement"; node = node.alternate) {
Copy link
Contributor Author

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?

@graingert
Copy link
Contributor Author

graingert commented Sep 4, 2017

@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)

@eslintbot
Copy link

LGTM

1 similar comment
@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@graingert graingert changed the title WIP: support else if in no-else-return #9228 support else if in no-else-return #9228 Sep 4, 2017
@eslintbot
Copy link

LGTM

@platinumazure
Copy link
Member

platinumazure commented Sep 5, 2017

@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 else if (even when not strictly necessary) for readability reasons. Anyone else have any thoughts?

@not-an-aardvark
Copy link
Member

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 not-an-aardvark added bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules labels Sep 5, 2017
@graingert
Copy link
Contributor Author

@not-an-aardvark what's the conclusion on this?

@eslintbot
Copy link

LGTM

@not-an-aardvark
Copy link
Member

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?

@platinumazure
Copy link
Member

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.

@not-an-aardvark not-an-aardvark added the tsc agenda This issue will be discussed by ESLint's TSC at the next meeting label Sep 12, 2017
@eslintbot
Copy link

LGTM

Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@graingert
Copy link
Contributor Author

@not-an-aardvark woop! What's the next step?

Copy link
Member

@platinumazure platinumazure left a 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.

Copy link
Member

@kaicataldo kaicataldo left a 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?

@graingert
Copy link
Contributor Author

graingert commented Sep 29, 2017 via email

@kaicataldo
Copy link
Member

kaicataldo commented Sep 29, 2017

But it's the most important part! Helps everyone know about and use your new feature :)

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@eslintbot
Copy link

LGTM

@graingert
Copy link
Contributor Author

@not-an-aardvark @kaicataldo added docs

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@graingert
Copy link
Contributor Author

@kaicataldo thanks for the review! What's the next step?

@not-an-aardvark
Copy link
Member

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.

@not-an-aardvark not-an-aardvark merged commit 1167638 into eslint:master Oct 2, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 1, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants