Browse Source
chore(eslint-config): 关闭 perfectionist 语义排序相关规则 (#8340)
关闭 sort-enums、sort-interfaces、sort-switch-case 和
sort-object-types,允许枚举成员、interface/type 成员及 switch 分支
按语义或数值顺序(如状态码按码值)排列,而非强制字母序。
pull/8343/head
xueyitt
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
0 deletions
-
internal/lint-configs/eslint-config/src/configs/perfectionist.ts
|
|
@ -11,6 +11,9 @@ export async function perfectionist(): Promise<Linter.Config[]> { |
|
|
perfectionistPlugin.configs['recommended-natural'], |
|
|
perfectionistPlugin.configs['recommended-natural'], |
|
|
{ |
|
|
{ |
|
|
rules: { |
|
|
rules: { |
|
|
|
|
|
'perfectionist/sort-enums': 'off', |
|
|
|
|
|
'perfectionist/sort-interfaces': 'off', |
|
|
|
|
|
'perfectionist/sort-switch-case': 'off', |
|
|
'perfectionist/sort-exports': [ |
|
|
'perfectionist/sort-exports': [ |
|
|
'error', |
|
|
'error', |
|
|
{ |
|
|
{ |
|
|
@ -85,6 +88,7 @@ export async function perfectionist(): Promise<Linter.Config[]> { |
|
|
type: 'natural', |
|
|
type: 'natural', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
|
|
|
'perfectionist/sort-object-types': 'off', |
|
|
'perfectionist/sort-objects': [ |
|
|
'perfectionist/sort-objects': [ |
|
|
'off', |
|
|
'off', |
|
|
{ |
|
|
{ |
|
|
|