-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
padded-blocks: Change default behavior so that string config affects blocks, classes, and switch statements #7879
Comments
Previous discussions: |
My thoughts:
Another option: If we wanted to deprecate the string option altogether, we could provide a config transform (maybe?) which would turn |
As a new ESLint user who has recently been bitten by this (see #7868), I'm in favour of this change (either as a new rule, or as a future breaking change to |
This has 3 👍s from team members, so I'm labelling it as accepted. |
This being a breaking change, does TSC need to review? (Currently we have two 👍s from TSC members and no opposition, so hopefully it'd be pretty smooth sailing.) |
@alberto Reassigning this to you since you have a PR up for this. Thanks for writing a PR! |
What rule do you want to change?
padded-blocks
Does this change cause the rule to produce more or fewer warnings?
More in certain circumstances.
How will the change be implemented? (New option, new default behavior, etc.)?
Change default behavior so that a configuration of
"always"
or"never"
will affect classes and switch statements, as well as blocks.Currently
"always"
and"never"
only affect blocks for backward compatibility reasons. This proposal is to change that behavior (making the rule more intuitive and consistent) in a major release.Please provide some example code that this change will affect:
What does the rule currently do for this code?
Does not warn, since these are not BlockStatements.
What will the rule do after it's changed?
Warn-- the switch and class lack appropriate padding. Analogous cases can be created for the
"never"
string configuration as well.The text was updated successfully, but these errors were encountered: