Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore: enable no-confusing-void-expression internally#8375
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
chore: enable no-confusing-void-expression internally#8375
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedFeb 4, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
nx-cloudbot commentedFeb 4, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
codecovbot commentedFeb 4, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #8375 +/- ##==========================================+ Coverage 86.94% 87.79% +0.84%========================================== Files 252 398 +146 Lines 12251 13902 +1651 Branches 3861 4067 +206 ==========================================+ Hits 10652 12205 +1553- Misses 1332 1400 +68- Partials 267 297 +30
Flags with carried forward coverage won't be shown.Click here to find out more.
|
JoshuaKGoldberg commentedFeb 5, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'll wait to merge these changes until the flat config work lands. Edit: ✔️ |
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.
Looking at the changes - TBH I don't really like this rule.
I don't think any of these changes improve clarity or readability of code.
The biggest issue I see is that if the function is implicitly typed or explicitly marked as returningvoid
the rule still requires you to change things.
For example this code should pass the rule, IMO:
functionreturnsVoid():void{}functiontest1():void{returnreturnsVoid();// should be fine}consttest2=():void=>returnsVoid();// should be fine
Because there's nothing confusing about that code - the expressions are all typed asvoid
and the functions are typed asvoid
.
Also changes like() => expr
=>() => { expr }
actively reduce readability, IMO, esp when considering the above.
So I'm personally a bit 👎 on this.
👍 Blocked on#8538. |
PR Checklist
Overview
Enables the rule internally and runs its
--fix
to correct all violations. The fixed style isn't always quite what I'd want, but I figured anything we definitively don't like should probably be enforced with separate lint rules:for..of
instead of.forEach
{}
s around aswitch
case
unnecessarily