From 3e0dba1b5603b1f461a67765870c0bae7e4765ab Mon Sep 17 00:00:00 2001 From: Qing Date: Thu, 21 Mar 2024 01:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=E6=80=A7=E8=83=BD(deps):=20a?= =?UTF-8?q?dd=20auto-import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc-auto-import.json | 72 ++++++ .eslintrc.cjs | 215 +++++++++--------- src/api/login/login.ts | 12 +- src/components/echarts/ECharts.vue | 131 ++++++----- src/router/index.ts | 67 +++--- tsconfig.json | 100 ++++----- vite.config.mts | 337 +++++++++++++++-------------- 7 files changed, 506 insertions(+), 428 deletions(-) create mode 100644 .eslintrc-auto-import.json diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json new file mode 100644 index 0000000..dcf85eb --- /dev/null +++ b/.eslintrc-auto-import.json @@ -0,0 +1,72 @@ +{ + "globals": { + "Component": true, + "ComponentPublicInstance": true, + "ComputedRef": true, + "EffectScope": true, + "ExtractDefaultPropTypes": true, + "ExtractPropTypes": true, + "ExtractPublicPropTypes": true, + "InjectionKey": true, + "PropType": true, + "Ref": true, + "VNode": true, + "WritableComputedRef": true, + "computed": true, + "createApp": true, + "customRef": true, + "defineAsyncComponent": true, + "defineComponent": true, + "effectScope": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "h": true, + "inject": true, + "isProxy": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeRouteLeave": true, + "onBeforeRouteUpdate": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onDeactivated": true, + "onErrorCaptured": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onUnmounted": true, + "onUpdated": true, + "provide": true, + "reactive": true, + "readonly": true, + "ref": true, + "resolveComponent": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "toRaw": true, + "toRef": true, + "toRefs": true, + "toValue": true, + "triggerRef": true, + "unref": true, + "useAttrs": true, + "useCssModule": true, + "useCssVars": true, + "useLink": true, + "useRoute": true, + "useRouter": true, + "useSlots": true, + "watch": true, + "watchEffect": true, + "watchPostEffect": true, + "watchSyncEffect": true + } +} diff --git a/.eslintrc.cjs b/.eslintrc.cjs index dad959b..8d55e4b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,107 +1,108 @@ -module.exports = { - env: { - browser: true, - es2021: true, - node: true - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended' - ], - overrides: [ - { - env: { - node: true - }, - files: ['.eslintrc.{js,cjs}'], - parserOptions: { - sourceType: 'script' - } - } - ], - parserOptions: { - ecmaVersion: 'latest', - parser: '@typescript-eslint/parser', - sourceType: 'module' - }, - plugins: ['@typescript-eslint', 'vue'], - rules: { - indent: ['off', 2], - // 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', // 禁用 debugger - // 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', // 禁用 console - // 'no-bitwise': 'off', // 禁用按位运算符 - // 'no-tabs': 'off', // 禁用 tab - // 'array-element-newline': ['error', 'consistent'], // 强制数组元素间出现换行 - // indent: [ - // 'error', - // 2, - // { MemberExpression: 0, SwitchCase: 1, ignoredNodes: ['TemplateLiteral'] }, - // ], // 强制使用一致的缩进 - // quotes: ['error', 'single'], // 强制使用一致的反勾号、双引号或单引号 - // 'comma-dangle': ['error', 'always-multiline'], // 要求或禁止末尾逗号 - // 'object-curly-spacing': ['error', 'always'], // 强制在大括号中使用一致的空格 - // 'max-len': ['error', 120], // 强制一行的最大长度 - // 'no-new': 'off', // 禁止使用 new 以避免产生副作用 - // 'linebreak-style': 'off', // 强制使用一致的换行风格 - // 'import/extensions': 'off', // 确保在导入路径中统一使用文件扩展名 - // 'eol-last': 'off', // 要求或禁止文件末尾存在空行 - // 'no-shadow': 'off', // 禁止变量声明与外层作用域的变量同名 - // 'no-unused-vars': 'warn', // 禁止出现未使用过的变量 - // 'import/no-cycle': 'off', // 禁止一个模块导入一个有依赖路径的模块回到自己身上 - // 'arrow-parens': 'off', // 要求箭头函数的参数使用圆括号 - // semi: ['error', 'never'], // 要求或禁止使用分号代替 ASI - // eqeqeq: 'off', // 要求使用 === 和 !== - // 'no-param-reassign': 'off', // 禁止对 function 的参数进行重新赋值 - // 'import/prefer-default-export': 'off', // 如果模块只输入一个名字,则倾向于默认输出 - // 'no-use-before-define': 'off', // 禁止在变量定义之前使用它们,则倾向于默认输出 - // 'no-continue': 'off', // 禁用 continue 语句 - // 'prefer-destructuring': 'off', // 优先使用数组和对象解构 - // 'no-plusplus': 'off', // 禁用一元操作符 ++ 和 -- - // 'prefer-const': 'warn', // 要求使用 const 声明那些声明后不再被修改的变量 - // 'global-require': 'off', // 要求 require() 出现在顶层模块作用域中 - // 'no-prototype-builtins': 'off', // 禁止直接调用 Object.prototypes 的内置属性 - // 'consistent-return': 'off', // 要求 return 语句要么总是指定返回的值,要么不指定 - // 'one-var-declaration-per-line': 'off', // 要求或禁止在变量声明周围换行 - // 'one-var': 'off', // 强制函数中的变量要么一起声明要么分开声明 - // 'import/named': 'off', // 确保命名导入与远程文件中的命名导出相对应 - // 'object-curly-newline': 'off', // 强制大括号内换行符的一致性 - // 'default-case': 'off', // 要求 switch 语句中有 default 分支 - // 'no-trailing-spaces': 'off', // 禁用行尾空格 - // 'func-names': 'off', // 要求或禁止使用命名的 function 表达式 - // radix: 'off', // 强制在 parseInt() 使用基数参数 - // 'no-unused-expressions': 'off', // 禁止出现未使用过的表达式 - // 'no-underscore-dangle': 'off', // 禁止标识符中有悬空下划线 - // 'no-nested-ternary': 'off', // 禁用嵌套的三元表达式 - // 'no-restricted-syntax': 'off', // 禁用特定的语法 - // 'no-await-in-loop': 'off', // 禁止在循环中出现 await - // 'import/no-extraneous-dependencies': 'off', // 禁止使用外部包 - // 'import/no-unresolved': 'off', // 确保导入指向一个可以解析的文件/模块 - // 'template-curly-spacing': ['error', 'always'], // 要求或禁止模板字符串中的嵌入表达式周围空格的使用 - // '@typescript-eslint/no-var-requires': 'off', // 除import语句外,禁止使用require语句 - // '@typescript-eslint/no-empty-function': 'off', // 不允许空函数 - '@typescript-eslint/no-explicit-any': 'off', // 禁止使用 any 类型 - // 'guard-for-in': 'off', // 要求 for-in 循环中有一个 if 语句 - // 'class-methods-use-this': 'off', // 强制类方法使用 this - // 'vue/html-indent': ['error', 2], // 在