mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Eslint: fix indent rule for decorators (#15735)
This commit is contained in:
committed by
GitHub
parent
d73096a1c5
commit
74872602b9
+8
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user