Standard: padded-blocks for classes and switches

Created on 2 Sep 2016  路  3Comments  路  Source: standard/standard

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

enhancement

Most helpful comment

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

All 3 comments

@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.

Perfect, thanks!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mightyiam picture mightyiam  路  3Comments

christianalfoni picture christianalfoni  路  3Comments

gkatsanos picture gkatsanos  路  3Comments

johannes-z picture johannes-z  路  3Comments

davidjamesstone picture davidjamesstone  路  3Comments