Skip to content

Commit 73a43db

Browse files
committed
fix(eslint-config): improve @typescript-eslint/indent
1 parent f3b6192 commit 73a43db

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

packages/eslint-config/index.cjs

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = defineConfig({
5555
},
5656
parser: 'vue-eslint-parser',
5757
parserOptions: {
58-
ecmaVersion: 'latest',
58+
ecmaVersion: 'latest'
5959
},
6060
reportUnusedDisableDirectives: true,
6161
settings: {
@@ -69,7 +69,7 @@ module.exports = defineConfig({
6969
'.js',
7070
'.jsx',
7171
'.json',
72-
'.node',
72+
'.node'
7373
]
7474
}
7575
}
@@ -91,6 +91,44 @@ module.exports = defineConfig({
9191
'no-return-assign': 'off',
9292

9393
// typescript
94+
'@typescript-eslint/indent': ['error', 2, {
95+
SwitchCase: 1,
96+
VariableDeclarator: 1,
97+
outerIIFEBody: 1,
98+
MemberExpression: 1,
99+
FunctionDeclaration: { parameters: 1, body: 1 },
100+
FunctionExpression: { parameters: 1, body: 1 },
101+
CallExpression: { arguments: 1 },
102+
ArrayExpression: 1,
103+
ObjectExpression: 1,
104+
ImportDeclaration: 1,
105+
flatTernaryExpressions: false,
106+
ignoreComments: false,
107+
ignoredNodes: [
108+
'TemplateLiteral *',
109+
'JSXElement',
110+
'JSXElement > *',
111+
'JSXAttribute',
112+
'JSXIdentifier',
113+
'JSXNamespacedName',
114+
'JSXMemberExpression',
115+
'JSXSpreadAttribute',
116+
'JSXExpressionContainer',
117+
'JSXOpeningElement',
118+
'JSXClosingElement',
119+
'JSXFragment',
120+
'JSXOpeningFragment',
121+
'JSXClosingFragment',
122+
'JSXText',
123+
'JSXEmptyExpression',
124+
'JSXSpreadChild',
125+
'TSTypeParameterInstantiation',
126+
'FunctionExpression > .params[decorators.length > 0]',
127+
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
128+
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key'
129+
],
130+
offsetTernaryExpressions: true
131+
}],
94132
'@typescript-eslint/no-explicit-any': 'off',
95133
'@typescript-eslint/strict-boolean-expressions': 'off',
96134
'@typescript-eslint/space-before-function-paren': [

0 commit comments

Comments
 (0)