From 76c576a6f749fe7bb53eb3bee915997acb3449b6 Mon Sep 17 00:00:00 2001 From: xh <11675084@qq.com> Date: Sat, 17 Jan 2026 02:44:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/{.eslintrc.cjs => .eslintrc.cjs111} | 0 admin/eslint.config.ts | 46 ++++++++++++++++ admin/package.json | 52 ++++++++++--------- .../FcDesigner/components/FcDesigner.vue | 4 +- admin/src/components/footer-btns/index.vue | 3 ++ admin/src/components/highlight-code/index.vue | 3 ++ admin/src/components/image-contain/index.vue | 4 ++ admin/src/views/account/login.vue | 3 ++ admin/src/views/system/menu/edit.vue | 6 --- admin/src/views/system/post/edit.vue | 2 - 10 files changed, 89 insertions(+), 34 deletions(-) rename admin/{.eslintrc.cjs => .eslintrc.cjs111} (100%) create mode 100644 admin/eslint.config.ts diff --git a/admin/.eslintrc.cjs b/admin/.eslintrc.cjs111 similarity index 100% rename from admin/.eslintrc.cjs rename to admin/.eslintrc.cjs111 diff --git a/admin/eslint.config.ts b/admin/eslint.config.ts new file mode 100644 index 0000000..f46d618 --- /dev/null +++ b/admin/eslint.config.ts @@ -0,0 +1,46 @@ +import js from '@eslint/js' +import globals from 'globals' +import tseslint from 'typescript-eslint' +import pluginVue from 'eslint-plugin-vue' +import json from '@eslint/json' +import css from '@eslint/css' +import { defineConfig } from 'eslint/config' + +export default defineConfig([ + { + files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'], + plugins: { js }, + extends: ['js/recommended'], + languageOptions: { globals: globals.browser } + }, + tseslint.configs.recommended, + pluginVue.configs['flat/essential'], + { + files: ['**/*.vue'], + languageOptions: { parserOptions: { parser: tseslint.parser } }, + rules: { + 'vue/multi-word-component-names': 'off', + '@typescript-eslint/no-explicit-any': 'off', + 'no-empty': 'off' + } + }, + { + files: ['**/*.json'], + plugins: { json }, + language: 'json/json', + extends: ['json/recommended'] + }, + { + files: ['**/*.jsonc'], + plugins: { json }, + language: 'json/jsonc', + extends: ['json/recommended'] + }, + { + files: ['**/*.json5'], + plugins: { json }, + language: 'json/json5', + extends: ['json/recommended'] + } + // { files: ['**/*.css'], plugins: { css }, language: 'css/css', extends: ['css/recommended'] } +]) diff --git a/admin/package.json b/admin/package.json index a706d7f..cb8362f 100644 --- a/admin/package.json +++ b/admin/package.json @@ -10,7 +10,7 @@ "preview": "vite preview --port 4173 --mode development", "build:all": "node ./scripts/build.mjs", "type-check": "vue-tsc --noEmit --checkJs true --skipLibCheck", - "lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts src --fix --ignore-path .gitignore", + "lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts src --fix", "preinstall": "npx only-allow pnpm", "outdated": "pnpm outdated" }, @@ -21,7 +21,7 @@ "@highlightjs/vue-plugin": "^2.1.0", "@logicflow/core": "^2.2.0", "@logicflow/extension": "^2.2.0", - "@vueuse/core": "^13.5.0", + "@vueuse/core": "^14.1.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", "axios": "^1.13.2", @@ -29,48 +29,52 @@ "css-color-function": "^1.3.3", "dayjs": "^1.11.19", "echarts": "^6.0.0", - "element-plus": "^2.12.0", + "element-plus": "^2.13.1", "highlight.js": "^11.11.1", - "lodash-es": "^4.17.21", + "lodash-es": "^4.17.22", "nprogress": "^0.2.0", "pinia": "^3.0.3", "query-string": "^9.2.2", "spark-md5": "^3.0.2", - "vue": "^3.5.25", + "vue": "^3.5.26", "vue-clipboard3": "^2.0.0", - "vue-router": "^4.5.1", + "vue-router": "^4.6.4", "vue-virtual-scroller": "2.0.0-beta.8", "vue3-video-play": "^1.3.2", "vuedraggable": "^4.1.0", - "vxe-table": "^4.16.11" + "vxe-table": "^4.17.42" }, "devDependencies": { - "@rushstack/eslint-patch": "^1.11.0", + "@eslint/css": "^0.14.1", + "@eslint/js": "^9.39.2", + "@eslint/json": "^0.14.0", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.14.1", + "@types/node": "^25.0.9", "@types/nprogress": "^0.2.3", - "@vitejs/plugin-vue": "^6.0.2", - "@vitejs/plugin-vue-jsx": "^5.1.2", - "@vue/eslint-config-prettier": "^9.0.0", - "@vue/eslint-config-typescript": "^13.0.0", - "@vue/tsconfig": "^0.8.1", - "autoprefixer": "^10.4.22", - "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.27.0", + "@vitejs/plugin-vue": "^6.0.3", + "@vitejs/plugin-vue-jsx": "^5.1.3", + "autoprefixer": "^10.4.23", + "eslint": "^9.39.2", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-vue": "^10.7.0", "execa": "^9.5.2", - "fs-extra": "^11.3.0", + "fs-extra": "^11.3.3", + "globals": "^17.0.0", + "jiti": "^2.6.1", "postcss": "^8.5.3", - "prettier": "^3.6.2", + "prettier": "^3.8.0", "rollup-plugin-visualizer": "^6.0.3", - "sass": "^1.87.0", + "sass": "^1.97.2", "tailwindcss": "^3.4.15", - "typescript": "~5.8.3", - "unplugin-auto-import": "^19.3.0", - "unplugin-vue-components": "^28.7.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.53.0", + "unplugin-auto-import": "^21.0.0", + "unplugin-vue-components": "^31.0.0", "vite": "8.0.0-beta.0", "vite-plugin-compression": "^0.5.1", "vite-plugin-style-import": "^2.0.0", "vite-plugin-svg-icons": "^2.0.1", - "vue-tsc": "^3.0.6" + "vue-eslint-parser": "^10.2.0", + "vue-tsc": "^3.2.2" } } diff --git a/admin/src/components/FcDesigner/components/FcDesigner.vue b/admin/src/components/FcDesigner/components/FcDesigner.vue index c498b80..ef66a91 100644 --- a/admin/src/components/FcDesigner/components/FcDesigner.vue +++ b/admin/src/components/FcDesigner/components/FcDesigner.vue @@ -1452,7 +1452,7 @@ export default defineComponent({ if (!data.activeRule || data.validateForm.api[data.activeRule._fc_id] !== data.activeRule) return; methods.handleChange('', field, value, _, fapi); data.dragForm.api.refreshValidate(); - data.dragForm.api.nextTick(() => { + data.dragForm.api.nextTick()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(() => { data.dragForm.api.clearValidateState(data.activeRule.__fc__.id); }); }, @@ -1686,7 +1686,7 @@ export default defineComponent({ $required: formData.formCreate$required }; data.dragForm.api.refreshValidate(); - data.dragForm.api.nextTick(() => { + data.dragForm.api.nextTick()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()(() => { data.dragForm.api.clearValidateState(rule.__fc__.id); }); } diff --git a/admin/src/components/footer-btns/index.vue b/admin/src/components/footer-btns/index.vue index eb5aea2..272d69a 100644 --- a/admin/src/components/footer-btns/index.vue +++ b/admin/src/components/footer-btns/index.vue @@ -13,6 +13,9 @@ defineProps({ default: true } }) +defineOptions({ + name: 'FooterBtns' +})