Skip to content

Commit 92cc306

Browse files
committed
feature: eslint-config: indent: SwitchCase
1 parent 5794cdf commit 92cc306

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/eslint-config/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ export const rules = {
7777
'@stylistic/space-infix-ops': ['error', {
7878
int32Hint: false,
7979
}],
80-
'@stylistic/indent': [
81-
'error',
82-
4,
83-
],
80+
'@stylistic/indent': ['error', 4, {
81+
SwitchCase: 0,
82+
}],
8483
'@stylistic/space-in-parens': 'error',
8584
'@stylistic/space-before-blocks': 'error',
8685
'@stylistic/space-before-function-paren': ['error', {

packages/eslint-config/test/eslint-config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ test('eslint-config: no-prototype-builtins', async ({comparePlaces}) => {
7070
await comparePlaces('no-prototype-builtins', []);
7171
});
7272

73+
test('eslint-config: indent-switch', async ({comparePlaces}) => {
74+
await comparePlaces('indent-switch', []);
75+
});
76+
7377
test('eslint-config: no-delete-var', async ({comparePlaces}) => {
7478
await comparePlaces('no-delete-var', [], {
7579
rules: {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
switch(null) {
2+
case 1: {
3+
const m = 5;
4+
}
5+
}

0 commit comments

Comments
 (0)