From 49db40d557d54cd89c4d6366d82efc4ffaf2d097 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 3 Dec 2025 15:37:04 +0800 Subject: [PATCH] feat: cspell sort --- .vscode/settings.json | 13 +----------- cspell.json | 21 +++++++++++++------ .../eslint-config/src/configs/jsonc.ts | 16 ++++++++++++++ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f38c42781..7f3c7a4f4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -226,16 +226,5 @@ "commentTranslate.multiLineMerge": true, "vue.server.hybridMode": true, "typescript.tsdk": "node_modules/typescript/lib", - "oxc.enable": false, - "cSpell.words": [ - "archiver", - "axios", - "dotenv", - "isequal", - "jspm", - "napi", - "nolebase", - "rollup", - "vitest" - ] + "oxc.enable": false } diff --git a/cspell.json b/cspell.json index 6b94b7236..2331a497b 100644 --- a/cspell.json +++ b/cspell.json @@ -7,11 +7,14 @@ "acmr", "antd", "antdv", + "archiver", "astro", + "axios", "brotli", "clsx", "defu", "demi", + "dotenv", "echarts", "ependencies", "esno", @@ -20,6 +23,8 @@ "iconify", "iconoir", "intlify", + "isequal", + "jspm", "lockb", "lucide", "minh", @@ -27,7 +32,9 @@ "mkdist", "mockjs", "naiveui", + "napi", "nocheck", + "nolebase", "noopener", "noreferrer", "nprogress", @@ -37,6 +44,7 @@ "publint", "qrcode", "reka", + "rollup", "shadcn", "sonner", "sortablejs", @@ -52,19 +60,20 @@ "vite", "vitejs", "vitepress", + "vitest", "vnode", "vueuse", "yxxx" ], "ignorePaths": [ - "**/node_modules/**", - "**/dist/**", "**/*-dist/**", - "**/icons/**", - "pnpm-lock.yaml", "**/*.log", - "**/*.test.ts", "**/*.spec.ts", - "**/__tests__/**" + "**/*.test.ts", + "**/__tests__/**", + "**/dist/**", + "**/icons/**", + "**/node_modules/**", + "pnpm-lock.yaml" ] } diff --git a/internal/lint-configs/eslint-config/src/configs/jsonc.ts b/internal/lint-configs/eslint-config/src/configs/jsonc.ts index 4072e4cdd..4b92ff447 100644 --- a/internal/lint-configs/eslint-config/src/configs/jsonc.ts +++ b/internal/lint-configs/eslint-config/src/configs/jsonc.ts @@ -48,6 +48,7 @@ export async function jsonc(): Promise { }, sortTsconfig(), sortPackageJson(), + sortCspellJson(), ]; } @@ -130,6 +131,21 @@ function sortPackageJson(): Linter.Config { }; } +function sortCspellJson(): Linter.Config { + return { + files: ['**/cspell.json', '**/.cspell.json'], + rules: { + 'jsonc/sort-array-values': [ + 'error', + { + order: { type: 'asc' }, + pathPattern: '^words$|^ignorePaths$', + }, + ], + }, + }; +} + function sortTsconfig(): Linter.Config { return { files: [