Przeglądaj źródła

feat: cspell sort

xingyu4j 6 miesięcy temu
rodzic
commit
49db40d557

+ 1 - 12
.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
 }

+ 15 - 6
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"
   ]
 }

+ 16 - 0
internal/lint-configs/eslint-config/src/configs/jsonc.ts

@@ -48,6 +48,7 @@ export async function jsonc(): Promise<Linter.Config[]> {
     },
     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: [