From 9e21a1d036f7a7383b2751524bb5222e602fe58d Mon Sep 17 00:00:00 2001 From: tnt group Date: Thu, 1 Sep 2022 17:41:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=87=A0=E5=A4=84?= =?UTF-8?q?=20eslint=20=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tips/MacOsControlBtn/index.vue | 6 ++++-- src/store/modules/chartEditStore/chartEditStore.ts | 2 +- src/views/chart/hooks/useSync.hook.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Tips/MacOsControlBtn/index.vue b/src/components/Tips/MacOsControlBtn/index.vue index 980454d0..fbfd2c18 100644 --- a/src/components/Tips/MacOsControlBtn/index.vue +++ b/src/components/Tips/MacOsControlBtn/index.vue @@ -37,7 +37,9 @@ const props = defineProps({ hidden: { request: false, type: Array, - default: [] + default() { + return [] + } }, // 使用全屏功能 narrow: { @@ -76,7 +78,7 @@ const btnList: { icon: RemoveIcon }, { - title: isFull ? '缩小' : '放大', + title: isFull.value ? '缩小' : '放大', key: props.narrow ? 'fullResize' : 'resize', icon: ResizeIcon } diff --git a/src/store/modules/chartEditStore/chartEditStore.ts b/src/store/modules/chartEditStore/chartEditStore.ts index bd2f70ba..a2be5775 100644 --- a/src/store/modules/chartEditStore/chartEditStore.ts +++ b/src/store/modules/chartEditStore/chartEditStore.ts @@ -600,7 +600,7 @@ export const useChartEditStore = defineStore({ ids.push(item.id) }) } else { - ;(historyData[0] as CreateComponentGroupType).groupList.forEach(item => { + (historyData[0] as CreateComponentGroupType).groupList.forEach(item => { ids.push(item.id) }) } diff --git a/src/views/chart/hooks/useSync.hook.ts b/src/views/chart/hooks/useSync.hook.ts index 09a26aa9..a448f0e7 100644 --- a/src/views/chart/hooks/useSync.hook.ts +++ b/src/views/chart/hooks/useSync.hook.ts @@ -35,7 +35,7 @@ export const useSync = () => { } if (e.isGroup) { - ;(e as CreateComponentGroupType).groupList.forEach(groupItem => { + (e as CreateComponentGroupType).groupList.forEach(groupItem => { intComponent(groupItem) }) } else { From 610a8170efa73c34209827301564f52509218a38 Mon Sep 17 00:00:00 2001 From: tnt group Date: Thu, 1 Sep 2022 17:43:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20lint/lint:fix?= =?UTF-8?q?=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e5a71466..c4b0e1c3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", "new": "plop --plopfile ./plop/plopfile.js", - "postinstall": "husky install" + "postinstall": "husky install", + "lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0", + "lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --fix" }, "dependencies": { "@types/color": "^3.0.3", @@ -69,4 +71,4 @@ "vue-echarts": "^6.0.2", "vue-tsc": "^0.28.10" } -} \ No newline at end of file +} From 3adda1e3a41fa7311cf80e47170a48177df7a340 Mon Sep 17 00:00:00 2001 From: tnt group Date: Thu, 1 Sep 2022 17:46:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20eslint-plugin-vue=20v8.0+=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86?= =?UTF-8?q?=20lint=20=E6=8A=A5=20defineProps=20=E6=9C=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2b737770..d27e761e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,16 +9,17 @@ module.exports = { sourceType: 'module', ecmaFeatures: { jsx: true, - tsx: true, - }, + tsx: true + } }, env: { node: true, + // The Follow config only works with eslint-plugin-vue v8.0.0+ + 'vue/setup-compiler-macros': true }, - extends: ["plugin:vue/vue3-essential", "eslint:recommended"], + extends: ['plugin:vue/vue3-essential', 'eslint:recommended'], rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", - }, -}; - + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' + } +}