GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: enable no-else-return lint rule by lpinca · Pull Request #32667 · nodejs/node

Conversation

@lpinca

@lpinca lpinca commented Apr 5, 2020

Copy link
Copy Markdown
Member

Refs: #32644
Refs: #32662

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yashLadha, bricss, rickyes, ddazal, and himself65 reacted with thumbs up emoji
All reactions
  • 👍 5 reactions
@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Apr 5, 2020
@lpinca lpinca added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2020
@lpinca

lpinca commented Apr 5, 2020

Copy link
Copy Markdown
Member Author

Blocked to allow #32644 and #32662 to land first.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca
lpinca force-pushed the enable/no-else-return branch 4 times, most recently from 69890a3 to 73b15aa Compare April 5, 2020 12:48
@targos

targos commented Apr 6, 2020

Copy link
Copy Markdown
Member

I won't block this, but I personally prefer the way the current code is written.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devsnek

devsnek commented Apr 6, 2020

Copy link
Copy Markdown
Member

I think many of these cases are clearer when written including the else block.

addaleax and aduh95 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca

lpinca commented Apr 6, 2020

Copy link
Copy Markdown
Member Author

I have no strong opinion, this is just to have consistency and to not have PRs like #32644 and #32662.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca

lpinca commented Apr 8, 2020

Copy link
Copy Markdown
Member Author

Before closing I'll will rework the PR with the allowElseIf option set to true. It should remove most of the churn and the controversial changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca
lpinca force-pushed the enable/no-else-return branch 2 times, most recently from dd909ba to e404e2c Compare April 8, 2020 17:09
@lpinca

lpinca commented Apr 8, 2020

Copy link
Copy Markdown
Member Author

@targos @devsnek @addaleax PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Apr 8, 2020

Copy link
Copy Markdown
Member

@lpinca No strong opinions here. I like if (...) { return ...; } else { return ...; } if there is some kind of parallelism between the two statements, but ultimately, I really don’t care enough. As long as this is a lint rule that can work with make lint-js-fix, I’m good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Apr 8, 2020

Copy link
Copy Markdown
Member

same as @addaleax here

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca

lpinca commented Apr 8, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

The only reason for me is to prevent PRs with only cosmetic changes (unless we want them). In my opinion it's better for contributors to have a linter error than a PR rejected with a reason like "Cosmetic only changes".

Also cc @Trott who commented saying that he preferred to close this but then removed the comment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BridgeAR
BridgeAR approved these changes Apr 8, 2020
View reviewed changes

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

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. It reduces the number of code lines and the indentation which often improves the readability of the code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Trott

Trott commented Apr 8, 2020

Copy link
Copy Markdown
Member

Also cc @Trott who commented saying that he preferred to close this but then removed the comment.

I have no opinion on this. I'm fine with it landing, and fine with closing it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca
lpinca force-pushed the enable/no-else-return branch from e404e2c to 9b40e55 Compare April 19, 2020 06:10
@lpinca lpinca removed the blocked PRs that are blocked by other issues or PRs. label Apr 19, 2020
@lpinca
lpinca force-pushed the enable/no-else-return branch 2 times, most recently from e590a4f to 17c648a Compare April 25, 2020 17:55
@nodejs-github-bot

nodejs-github-bot commented May 3, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/31154/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label May 3, 2020
trivikr
trivikr approved these changes May 7, 2020
View reviewed changes
trivikr
trivikr approved these changes May 7, 2020
View reviewed changes
@lpinca
lpinca force-pushed the enable/no-else-return branch from 17c648a to 3c3c4e5 Compare May 12, 2020 18:00
@lpinca lpinca mentioned this pull request May 15, 2020
src: remove unnecessary else in base_object-inl.h #33413
Closed
2 tasks done
@nodejs-github-bot

nodejs-github-bot commented May 15, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/31345/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs nodejs deleted a comment from nodejs-github-bot May 15, 2020
@nodejs nodejs deleted a comment from nodejs-github-bot May 15, 2020
@lpinca
tools: enable no-else-return lint rule
af70a1c
Refs: nodejs#32644
Refs: nodejs#32662
@lpinca
lpinca force-pushed the enable/no-else-return branch from 3c3c4e5 to af70a1c Compare May 15, 2020 14:37
@nodejs-github-bot

nodejs-github-bot commented May 15, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/31349/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca added a commit that referenced this pull request May 16, 2020
@lpinca
tools: enable no-else-return lint rule
b533fb3
Refs: #32644
Refs: #32662

PR-URL: #32667
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@lpinca

lpinca commented May 16, 2020

Copy link
Copy Markdown
Member Author

Landed in b533fb3.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca lpinca closed this May 16, 2020
@lpinca
lpinca deleted the enable/no-else-return branch May 16, 2020 04:44
codebytere pushed a commit that referenced this pull request May 16, 2020
@lpinca @codebytere
tools: enable no-else-return lint rule
9119344
Refs: #32644
Refs: #32662

PR-URL: #32667
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@codebytere codebytere mentioned this pull request May 18, 2020
v14.3.0 proposal #33452
Merged
@codebytere

codebytere commented Jul 8, 2020

Copy link
Copy Markdown
Member

@lpinca would you mind backporting this to v12.x? there are a solid handful of conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codebytere codebytere added the backport-requested-v12.x label Jul 8, 2020
@lpinca

lpinca commented Jul 9, 2020

Copy link
Copy Markdown
Member Author

yes, I will do it later today.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lpinca lpinca mentioned this pull request Jul 9, 2020
[v12.x backport] tools: enable no-else-return lint rule #34275
Closed
2 of 4 tasks
lpinca added a commit to lpinca/node that referenced this pull request Jul 9, 2020
@lpinca
tools: enable no-else-return lint rule
441e6d9
Refs: nodejs#32644
Refs: nodejs#32662

PR-URL: nodejs#32667
Backport-PR-URL: nodejs#34275
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
codebytere pushed a commit that referenced this pull request Jul 13, 2020
@lpinca @codebytere
tools: enable no-else-return lint rule
a131c72
Refs: #32644
Refs: #32662

PR-URL: #32667
Backport-PR-URL: #34275
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@codebytere codebytere mentioned this pull request Jul 13, 2020
v12.18.3 proposal #34343
Merged
codebytere pushed a commit that referenced this pull request Jul 14, 2020
@lpinca @codebytere
tools: enable no-else-return lint rule
248f9af
Refs: #32644
Refs: #32662

PR-URL: #32667
Backport-PR-URL: #34275
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@lpinca lpinca added backported-to-v12.x and removed backport-requested-v12.x labels Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@BridgeAR BridgeAR BridgeAR approved these changes
@trivikr trivikr trivikr approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@lpinca @targos @devsnek @addaleax @Trott @nodejs-github-bot @codebytere @BridgeAR @trivikr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.