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

padded-blocks for classes and switches #610

Closed
caesarsol opened this Issue Sep 2, 2016 · 3 comments

Comments

2 participants
@caesarsol
Copy link

commented Sep 2, 2016

As of now, the padded-blocks rule is configured as:

"padded-blocks": [2, "never"],

Since:

"always" requires empty lines at the beginning and ending of block statements (except switch statements and classes)
"never" disallows empty lines at the beginning and ending of block statements

And this implies that in classes and switch statements the never-padded-blocks is not enforced, wouldn't it be coherent to modify the rule as this?

"padded-blocks": [2, { "blocks": "never", "switches": "never", "classes": "never" }],

Here is the reference: http://eslint.org/docs/rules/padded-blocks#classes

@feross

This comment has been minimized.

Copy link
Member

commented Sep 10, 2016

@caesarsol Yes, you're right. It looks like these additional cases were added to eslint but aren't covered by the current "never" setting.

We'll add this in standard v9.

@feross feross added this to the standard v9 milestone Sep 10, 2016

@feross feross added the enhancement label Sep 10, 2016

@caesarsol

This comment has been minimized.

Copy link
Author

commented Sep 10, 2016

Perfect, thanks!

feross added a commit to standard/eslint-config-standard that referenced this issue Feb 9, 2017

Disallow padding within switch statements and classes (padded-blocks)
Currently, we disallow empty lines at the beginning and ending of block
statements (except switch statements and classes).

This rule change also applies this rule to switch statements and
classes.

Fixes: standard/standard#610
@feross

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

This will be part of standard v9. No ecosystem impact.

@feross feross closed this Feb 9, 2017

feross added a commit to standard/eslint-config-standard that referenced this issue Feb 9, 2017

Disallow padding within switch statements and classes (padded-blocks)
Currently, we disallow empty lines at the beginning and ending of block
statements (except switch statements and classes).

This rule change also applies this rule to switch statements and
classes.

Fixes: standard/standard#610

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.