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' + } +} 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 +} 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 {