eslint: update rules for jsx

This commit is contained in:
undefined committed 2025-08-13 04:38:53 +08:00
1 parent a3128c001f
commit ce945c317d
2 files changed
+57 -30

No files matched your search

+46 -6
View File
@@ -121,12 +121,52 @@ const config = react({
// FIXME A bug with eslint-parser
// 'template-curly-spacing': 'off',
'style/indent': [
'warn',
2,
{ SwitchCase: 1 },
],
'style/indent-binary-ops': ['warn', 2],
'style/indent': ['warn', 2, {
ArrayExpression: 1,
CallExpression: {
arguments: 1,
},
flatTernaryExpressions: false,
FunctionDeclaration: {
body: 1,
parameters: 1,
},
FunctionExpression: {
body: 1,
parameters: 1,
},
ignoreComments: false,
ignoredNodes: [
'TSUnionType',
'TSIntersectionType',
'TSTypeParameterInstantiation',
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'JSXElement',
'JSXElement > *',
'JSXAttribute',
'JSXIdentifier',
'JSXNamespacedName',
'JSXMemberExpression',
'JSXSpreadAttribute',
'JSXExpressionContainer',
'JSXOpeningElement',
'JSXClosingElement',
'JSXFragment',
'JSXOpeningFragment',
'JSXClosingFragment',
'JSXText',
'JSXEmptyExpression',
'JSXSpreadChild',
],
ImportDeclaration: 1,
ObjectExpression: 1,
outerIIFEBody: 1,
SwitchCase: 1,
VariableDeclarator: 1,
}],
'style/jsx-indent-props': 'off',
'style/indent-binary-ops': 'off',
'function-paren-newline': 'off',
'no-mixed-operators': 'off',
'no-await-in-loop': 'off',