Sfoglia il codice sorgente

fix: align oxfmt json commas with lint

xingyu4j 3 mesi fa
parent
commit
e3e869faee
2 ha cambiato i file con 10 aggiunte e 5 eliminazioni
  1. 2 5
      .vscode/settings.json
  2. 8 0
      internal/lint-configs/oxfmt-config/src/index.ts

+ 2 - 5
.vscode/settings.json

@@ -63,16 +63,13 @@
     "editor.defaultFormatter": "oxc.oxc-vscode"
   },
   "[json]": {
-    "editor.defaultFormatter": "vscode.json-language-features"
+    "editor.defaultFormatter": "oxc.oxc-vscode"
   },
   "[markdown]": {
     "editor.defaultFormatter": "oxc.oxc-vscode"
   },
   "[jsonc]": {
-    "editor.defaultFormatter": "vscode.json-language-features"
-  },
-  "[json5]": {
-    "editor.defaultFormatter": "vscode.json-language-features"
+    "editor.defaultFormatter": "oxc.oxc-vscode"
   },
   "[vue]": {
     "editor.defaultFormatter": "oxc.oxc-vscode"

+ 8 - 0
internal/lint-configs/oxfmt-config/src/index.ts

@@ -9,6 +9,14 @@ const oxfmtConfig = defineOxfmtConfig({
   singleQuote: true,
   sortPackageJson: false,
   trailingComma: 'all',
+  overrides: [
+    {
+      files: ['**/*.json', '**/*.json5', '**/*.jsonc', '*.code-workspace'],
+      options: {
+        trailingComma: 'none',
+      },
+    },
+  ],
 });
 
 function defineConfig(config: OxfmtConfig = {}) {