lint: fix eslint indentation for switch cases (#2520)

also trying to preserve call indentations, but afraid its not exactly the same, but fairly close
This commit is contained in:
Daniel Salazar
2026-02-20 17:22:00 -08:00
committed by GitHub
parent 3b32b4a437
commit 22c1cd8be4
2 changed files with 6 additions and 6 deletions
+3 -5
View File
@@ -25,12 +25,9 @@ export const rules = {
'@stylistic/curly-newline': ['error', 'always'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/indent': ['error', 4, {
ignoredNodes: [
'CallExpression',
'NewExpression',
],
SwitchCase: 1,
CallExpression: {
arguments: 4,
arguments: 1,
},
}],
'@stylistic/indent-binary-ops': ['error', 4],
@@ -38,6 +35,7 @@ export const rules = {
'@stylistic/semi': ['error', 'always'],
'@stylistic/quotes': ['error', 'single', { 'avoidEscape': true }],
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
'@stylistic/space-before-function-paren': 'error',
'@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
+3 -1
View File
@@ -125,6 +125,8 @@ export default {
const closeParen = sourceCode.getLastToken(node, token => token.value === ')');
if ( !openParen || !closeParen ) return;
// Defer multi-line call/new formatting to stylistic paren/argument rules.
if ( openParen.loc.start.line !== closeParen.loc.end.line ) return;
const afterOpen = sourceCode.getTokenAfter(openParen);
const beforeClose = sourceCode.getTokenBefore(closeParen);
@@ -201,4 +203,4 @@ export default {
},
};
},
};
};