From 9dd936cee5c8fc606381cf4b799af35cd2e3dc99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E8=85=BE=E9=9D=96?= Date: Sun, 7 Jul 2024 21:30:47 +0800 Subject: [PATCH] build(eslint): optimize jsonc/comma-dangle config --- .eslintrc.cjs | 9 +++++++++ .vscode/settings.json | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d7887aa..aacbe3e 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,4 +1,5 @@ process.env.ESLINT_TSCONFIG = 'tsconfig.json' +const jsonExtJsoncFiles = ['**/tsconfig.*.json', '.vscode/*.json'] module.exports = { root: true, @@ -324,6 +325,7 @@ module.exports = { // this will cause many changes when auto fix package.json 'jsonc/sort-keys': 'off', + 'jsonc/comma-dangle': ['error', 'always-multiline'], }, overrides: [ @@ -334,5 +336,12 @@ module.exports = { 'unicorn/prefer-node-protocol': 'off', }, }, + { + files: ['*.json'], + excludedFiles: jsonExtJsoncFiles, + rules: { + 'jsonc/comma-dangle': 'off', + }, + }, ], } diff --git a/.vscode/settings.json b/.vscode/settings.json index f92ec9e..92eef22 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "kobalte", "lucide", "iconbox", - "Zustand" + "Zustand", ], "svg.preview.background": "transparent", @@ -14,12 +14,12 @@ "prettier.enable": false, "editor.formatOnSave": false, "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" + "source.fixAll.eslint": "explicit", }, "tailwindCSS.experimental.classRegex": [ "\\b(?:class|className): *`((.|\n)*?)`", "\\b(?:class|className): *\"((.|\n)*?)\"", - "\\b(?:class|className): *'((.|\n)*?)'" - ] + "\\b(?:class|className): *'((.|\n)*?)'", + ], }