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

📎 Implement lint/noUselessElse - eslint/no-else-return #247

Closed
Conaclos opened this issue Sep 11, 2023 · 1 comment · Fixed by #331
Closed

📎 Implement lint/noUselessElse - eslint/no-else-return #247

Conaclos opened this issue Sep 11, 2023 · 1 comment · Fixed by #331
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@Conaclos
Copy link
Member

Conaclos commented Sep 11, 2023

Description

Implement ESLint rule no-else-return

I propose extending the rule to report the following cases

  if () {
    f()
    break;
  }
- else {
    ...
- }
}
  if () {
    f()
    continue;
  }
- else {
    ...
- }
}
  if () {
    f()
    return;
  }
- else {
    ...
- }
}
  if () {
    f()
    break
  }
- else {}
}

The rule could thus be named noUselessElse.
The rule should also cover else if and could provide a safe fix.

Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.

@Conaclos Conaclos added S-Help-wanted Status: you're familiar with the code base and want to help the project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Sep 11, 2023
@Conaclos Conaclos self-assigned this Sep 17, 2023
@Conaclos
Copy link
Member Author

Implemented in #331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant