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

Style/GuardClause could prevent useless else after multiline guard #11760

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TSMMark
Copy link
Contributor

@TSMMark TSMMark commented Apr 4, 2023

eslint has no-else-return https://eslint.org/docs/latest/rules/no-else-return

I think Rubocop's Style/GuardClause rule could apply a similar style enforcement


I have committed a failing test to exemplify what I envision, and will open this PR as Draft. I would like to know if maintainers would support such functionality before I spend the time implementing it.

Thanks!

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 22, 2023

@TSMMark Doesn't Lint/UnreachableCode flag this already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants