Skip to content

Commit f878eda

Browse files
Thomas Graingerljharb
authored andcommitted
[eslint config] [base] [patch] also disallow padding in classes and switches
1 parent 5aa203e commit f878eda

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,7 +2396,7 @@ Other Style Guides
23962396
23972397
}
23982398
2399-
// also bad
2399+
// bad
24002400
if (baz) {
24012401
24022402
console.log(qux);
@@ -2405,6 +2405,14 @@ Other Style Guides
24052405
24062406
}
24072407
2408+
// bad
2409+
class Foo {
2410+
2411+
constructor(bar) {
2412+
this.bar = bar;
2413+
}
2414+
}
2415+
24082416
// good
24092417
function bar() {
24102418
console.log(foo);

packages/eslint-config-airbnb-base/rules/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ module.exports = {
368368
// enforce operators to be placed before or after line breaks
369369
'operator-linebreak': 'off',
370370

371-
// enforce padding within blocks
372-
'padded-blocks': ['error', 'never'],
371+
// disallow padding within blocks
372+
'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }],
373373

374374
// Require or disallow padding lines between statements
375375
// http://eslint.org/docs/rules/padding-line-between-statements

0 commit comments

Comments
 (0)