Eslint: fix indent rule for decorators (#15735)

This commit is contained in:
Leslie Leigh (李的序)
2023-07-31 14:19:28 +08:00
committed by GitHub
parent d73096a1c5
commit 74872602b9
+8 -4
View File
@@ -70,7 +70,14 @@ rules:
import/extensions: off # typescript doesn't support this
import/no-unresolved: off # TODO: fix internal modules
import/prefer-default-export: off # prefer named exports
indent: off # use @typescript-eslint/indent instead for better compatibility
indent: [error, 4, {
SwitchCase: 0,
ignoredNodes: [ # https://stackoverflow.com/a/72897089
"FunctionExpression > .params[decorators.length > 0]",
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key",
]
}]
lines-between-class-members: off # be more lenient on member declarations
max-classes-per-file: off # helper classes are common
@@ -103,9 +110,6 @@ rules:
'ts-nocheck': true,
'ts-check': false,
}]
'@typescript-eslint/indent': [warn, 4, {
SwitchCase: 0
}]
'@typescript-eslint/no-unused-expressions': warn
# TODO: this is just too much work