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
Closed

padded-blocks for classes and switches #610

caesarsol opened this issue Sep 2, 2016 · 3 comments

Comments

@caesarsol
Copy link

caesarsol 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
Copy link
Member

feross 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
@caesarsol
Copy link
Author

Perfect, thanks!

feross added a commit to standard/eslint-config-standard that referenced this issue Feb 9, 2017
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
Copy link
Member

feross commented Feb 9, 2017

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

@feross feross closed this as completed Feb 9, 2017
feross added a commit to standard/eslint-config-standard that referenced this issue Feb 9, 2017
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.
Projects
Archived in project
Development

No branches or pull requests

2 participants