[eslint config] [base] [patch] also disallow padding in classes and switches

This commit is contained in:
Thomas Grainger
2017-05-05 11:42:43 +01:00
committed by Jordan Harband
parent 5aa203eaa8
commit f878edad25
2 changed files with 11 additions and 3 deletions

View File

@@ -2396,7 +2396,7 @@ Other Style Guides
}
// also bad
// bad
if (baz) {
console.log(qux);
@@ -2405,6 +2405,14 @@ Other Style Guides
}
// bad
class Foo {
constructor(bar) {
this.bar = bar;
}
}
// good
function bar() {
console.log(foo);

View File

@@ -368,8 +368,8 @@ module.exports = {
// enforce operators to be placed before or after line breaks
'operator-linebreak': 'off',
// enforce padding within blocks
'padded-blocks': ['error', 'never'],
// disallow padding within blocks
'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }],
// Require or disallow padding lines between statements
// http://eslint.org/docs/rules/padding-line-between-statements