feat(eslint): 添加 jsonc 插件并启用 JSON 文件键排序规则
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 2m54s
CI/CD Pipeline / build-and-deploy (push) Failing after 4m9s

新增 `eslint-plugin-jsonc` 插件,并在 `.json` 文件中启用 `jsonc/sort-keys` 规则,
以确保本地化文件中的键名按字母顺序排列。此举有助于减少多人协作时的合并冲突,
同时提升代码一致性和可维护性。

此外,调整了 VS Code 配置项顺序以优化读写逻辑,并更新相关依赖版本。
This commit is contained in:
严浩
2025-11-04 00:52:22 +08:00
parent acd7c0db13
commit 5bbbf488fe
6 changed files with 91 additions and 16 deletions

58
pnpm-lock.yaml generated
View File

@@ -162,6 +162,9 @@ importers:
eslint-plugin-import:
specifier: ^2.32.0
version: 2.32.0(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))
eslint-plugin-jsonc:
specifier: ^2.21.0
version: 2.21.0(eslint@9.38.0(jiti@2.6.1))
eslint-plugin-oxlint:
specifier: ~1.23.0
version: 1.23.0
@@ -3261,6 +3264,10 @@ packages:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
diff-sequences@27.5.1:
resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
dir-glob@3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
@@ -3405,6 +3412,12 @@ packages:
engines: {node: '>=6.0'}
hasBin: true
eslint-compat-utils@0.6.5:
resolution: {integrity: sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ==}
engines: {node: '>=12'}
peerDependencies:
eslint: '>=6.0.0'
eslint-config-prettier@10.1.8:
resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==}
hasBin: true
@@ -3414,6 +3427,17 @@ packages:
eslint-import-resolver-node@0.3.9:
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
eslint-json-compat-utils@0.2.1:
resolution: {integrity: sha512-YzEodbDyW8DX8bImKhAcCeu/L31Dd/70Bidx2Qex9OFUtgzXLqtfWL4Hr5fM/aCCB8QUZLuJur0S9k6UfgFkfg==}
engines: {node: '>=12'}
peerDependencies:
'@eslint/json': '*'
eslint: '*'
jsonc-eslint-parser: ^2.4.0
peerDependenciesMeta:
'@eslint/json':
optional: true
eslint-module-utils@2.12.1:
resolution: {integrity: sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==}
engines: {node: '>=4'}
@@ -3445,6 +3469,12 @@ packages:
'@typescript-eslint/parser':
optional: true
eslint-plugin-jsonc@2.21.0:
resolution: {integrity: sha512-HttlxdNG5ly3YjP1cFMP62R4qKLxJURfBZo2gnMY+yQojZxkLyOpY1H1KRTKBmvQeSG9pIpSGEhDjE17vvYosg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
eslint-plugin-oxlint@1.23.0:
resolution: {integrity: sha512-YT/ObCQMluSHVEqDJPwrVLERkUUQnmcRYYQbB7h6t2P4243WE3Z1UmUcPy1Q6vSVP/U7vw5affptlGV2RizDuw==}
@@ -9006,6 +9036,8 @@ snapshots:
detect-libc@2.1.2: {}
diff-sequences@27.5.1: {}
dir-glob@3.0.1:
dependencies:
path-type: 4.0.0
@@ -9268,6 +9300,11 @@ snapshots:
optionalDependencies:
source-map: 0.6.1
eslint-compat-utils@0.6.5(eslint@9.38.0(jiti@2.6.1)):
dependencies:
eslint: 9.38.0(jiti@2.6.1)
semver: 7.7.3
eslint-config-prettier@10.1.8(eslint@9.38.0(jiti@2.6.1)):
dependencies:
eslint: 9.38.0(jiti@2.6.1)
@@ -9280,6 +9317,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-json-compat-utils@0.2.1(eslint@9.38.0(jiti@2.6.1))(jsonc-eslint-parser@2.4.0):
dependencies:
eslint: 9.38.0(jiti@2.6.1)
esquery: 1.6.0
jsonc-eslint-parser: 2.4.0
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.38.0(jiti@2.6.1)):
dependencies:
debug: 3.2.7
@@ -9319,6 +9362,21 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
eslint-plugin-jsonc@2.21.0(eslint@9.38.0(jiti@2.6.1)):
dependencies:
'@eslint-community/eslint-utils': 4.9.0(eslint@9.38.0(jiti@2.6.1))
diff-sequences: 27.5.1
eslint: 9.38.0(jiti@2.6.1)
eslint-compat-utils: 0.6.5(eslint@9.38.0(jiti@2.6.1))
eslint-json-compat-utils: 0.2.1(eslint@9.38.0(jiti@2.6.1))(jsonc-eslint-parser@2.4.0)
espree: 10.4.0
graphemer: 1.4.0
jsonc-eslint-parser: 2.4.0
natural-compare: 1.4.0
synckit: 0.11.11
transitivePeerDependencies:
- '@eslint/json'
eslint-plugin-oxlint@1.23.0:
dependencies:
jsonc-parser: 3.3.1