mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 00:28:25 -05:00
[eslint config] [base] [patch] also disallow padding in classes and switches
This commit is contained in:
committed by
Jordan Harband
parent
5aa203eaa8
commit
f878edad25
10
README.md
10
README.md
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user