-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Add rule no-case-declarations #137
Conversation
Rule addition now has no impact.
|
One repo started failing, but I PR'd it: zensh/resp.js#3 |
Let's ship this in |
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.
Oh, wow. I didn't even realize that the code after case foo:
is not a block. And that I could simply add a block there. Lovely. Excellent rule, it seems.
@mightyiam Yeah, this blew my mind as well when I discovered it. Now I always use blocks in case statements. |
@justinkalland Btw, thanks for the pull request! You're awesome! 🤩 |
Just discovered this rule from upgrading to standard 14 and grumbled until I read https://eslint.org/docs/rules/no-case-declarations and learned something new. Thank you! I feel like each of these rules deserves its own class or blog or something, so much to learn about here. Okay good night 👋 |
@ungoldman Indeed! Perhaps we can add such explanations to the |
Adds the rule
no-case-declarations
.Ecosystem impact:
Failing packages:
References: