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 useImmediateReturn #4748

Open
dyc3 opened this issue Dec 16, 2024 · 7 comments
Open

📎 Implement useImmediateReturn #4748

dyc3 opened this issue Dec 16, 2024 · 7 comments
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Comments

@dyc3
Copy link
Contributor

dyc3 commented Dec 16, 2024

Description

Port the prefer-immediate-return rule from eslint-plugin-sonarjs.

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.

@dyc3 dyc3 added good first issue Good for newcomers A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Dec 16, 2024
@ematipico
Copy link
Member

This sounds like more an assist action rather than a lint rule 🤔

@florianmatz
Copy link

@ematipico eslint itself has kind of the same rule - arrow-body-style when configured to ‘as-needed’ or ‘never’.

@ematipico
Copy link
Member

Yeah but this is a styling thing and it doesn't fit our rule pillars. An assist action seems to cover that

@florianmatz
Copy link

florianmatz commented Dec 16, 2024

🤷 - this can be said for a bunch of rules like ‘ useConsistentCurlyBraces’? Also more style related IMHO and still useful / relevant?

@ematipico
Copy link
Member

Yes, there's a good chance we're going to move it

@dyc3
Copy link
Contributor Author

dyc3 commented Dec 17, 2024

After looking at it again, I agree that this seems like an assist. Do we have guidelines (like our rule pillars) for what should be a lint vs assist?

@dyc3 dyc3 removed the good first issue Good for newcomers label Dec 17, 2024
@ematipico
Copy link
Member

@dyc3

I usually use our rule pillars to understand if a rule should be part of the linter or not.

Another thing that I use as a guideline is editors. IntelliJ comes to mind, for example. For useImmediateReturn, this is usually suggested as a refactor opportunity by the editor.

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
Projects
None yet
Development

No branches or pull requests

3 participants