diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index db4c6d9b..00000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -node_modules \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 62ad3968..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') - -// @see https://eslint.bootcss.com/docs/rules/ -module.exports = { - root: true, - env: { - browser: true, - es2021: true, - node: true, - jest: true - }, - /* 指定如何解析语法 */ - parser: 'vue-eslint-parser', - /** 优先级低于 parse 的语法解析配置 */ - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - parser: '@typescript-eslint/parser', - jsxPragma: 'React', - ecmaFeatures: { - jsx: true - } - }, - /* 继承已有的规则(全部规则默认是关闭的, 这个配置项开启推荐规则, 推荐规则参照文档) */ - extends: [ - 'eslint:recommended', // 比如: 函数不能重名、对象不能出现重复key - 'plugin:vue/vue3-essential', // vue3语法规则 - 'plugin:vue/vue3-recommended', - '@vue/eslint-config-typescript/recommended', // ts语法规则 - '@vue/eslint-config-prettier' - ], - plugins: ['vue', '@typescript-eslint'], - /* - * "off" 或 0 ==> 关闭规则 - * "warn" 或 1 ==> 打开的规则作为警告(不影响代码执行) - * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错) - */ - rules: { - // eslint(https://eslint.bootcss.com/docs/rules/) - 'no-var': 'error', // 要求使用 let 或 const 而不是 var - 'no-multiple-empty-lines': ['warn', { max: 1 }], // 不允许多个空行 - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-unexpected-multiline': 'error', // 禁止空余的多行 - 'no-useless-escape': 'off', // 禁止不必要的转义字符 - - // typeScript (https://typescript-eslint.io/rules) - '@typescript-eslint/no-unused-vars': 'error', // 禁止定义未使用的变量 - '@typescript-eslint/prefer-ts-expect-error': 'error', // 禁止使用 @ts-ignore - '@typescript-eslint/no-explicit-any': 'off', // 禁止使用 any 类型 - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-namespace': 'off', // 禁止使用自定义 TypeScript 模块和命名空间 - '@typescript-eslint/semi': 'off', - - // eslint-plugin-vue (https://eslint.vuejs.org/rules/) - 'vue/multi-word-component-names': 'off', // 要求组件名称始终为 “-” 链接的单词 - 'vue/script-setup-uses-vars': 'error', // 防止 diff --git a/src/components/GiCell/GiCellGender.vue b/src/components/GiCell/GiCellGender.vue index 6a70fdfa..2b117b1a 100644 --- a/src/components/GiCell/GiCellGender.vue +++ b/src/components/GiCell/GiCellGender.vue @@ -15,13 +15,13 @@ diff --git a/src/components/GiCell/GiCellStatus.vue b/src/components/GiCell/GiCellStatus.vue index f441974a..449bc759 100644 --- a/src/components/GiCell/GiCellStatus.vue +++ b/src/components/GiCell/GiCellStatus.vue @@ -12,13 +12,13 @@ diff --git a/src/components/GiCell/GiCellTags.vue b/src/components/GiCell/GiCellTags.vue index 1d2c7bd5..b925a584 100644 --- a/src/components/GiCell/GiCellTags.vue +++ b/src/components/GiCell/GiCellTags.vue @@ -21,13 +21,13 @@ diff --git a/src/components/GiCodeView/index.vue b/src/components/GiCodeView/index.vue index 12ed8642..fe7c3b94 100644 --- a/src/components/GiCodeView/index.vue +++ b/src/components/GiCodeView/index.vue @@ -17,6 +17,10 @@ import { githubLight } from '@ddietr/codemirror-themes/github-light' import { oneDark } from '@codemirror/theme-one-dark' import { useAppStore } from '@/stores' +const props = withDefaults(defineProps(), { + type: 'javascript', + codeJson: '' +}) const appStore = useAppStore() const isDark = computed(() => appStore.theme === 'dark') @@ -24,11 +28,6 @@ interface Props { type?: 'javascript' | 'vue' codeJson: string } -const props = withDefaults(defineProps(), { - type: 'javascript', - codeJson: '' -}) - const defaultConfig = { tabSize: 2, basic: true, diff --git a/src/components/GiDot/index.tsx b/src/components/GiDot/index.tsx index bc2525cd..2f34771e 100644 --- a/src/components/GiDot/index.tsx +++ b/src/components/GiDot/index.tsx @@ -1,4 +1,4 @@ -import { defineComponent, type PropType } from 'vue' +import { type PropType, defineComponent } from 'vue' import './dot.scss' type TPropsType = 'primary' | 'success' | 'warning' | 'danger' | 'info' diff --git a/src/components/GiFlexibleBox/index.vue b/src/components/GiFlexibleBox/index.vue index 70361394..458157d8 100644 --- a/src/components/GiFlexibleBox/index.vue +++ b/src/components/GiFlexibleBox/index.vue @@ -9,22 +9,22 @@ import type { CSSProperties } from 'vue' defineOptions({ name: 'GiFlexibleBox' }) -interface Props { - modelValue: boolean - direction: 'left' | 'right' -} - const props = withDefaults(defineProps(), { modelValue: false, direction: 'right' }) +interface Props { + modelValue: boolean + direction: 'left' | 'right' +} + const BoxRef = ref() const style = computed(() => { const obj: CSSProperties = {} - obj[`margin-${props.direction}`] = - !props.modelValue && BoxRef.value && BoxRef.value.clientWidth ? `-${BoxRef.value.clientWidth}px` : 0 + obj[`margin-${props.direction}`] + = !props.modelValue && BoxRef.value && BoxRef.value.clientWidth ? `-${BoxRef.value.clientWidth}px` : 0 return obj }) diff --git a/src/components/GiFooter/index.vue b/src/components/GiFooter/index.vue index da3d327e..4d243922 100644 --- a/src/components/GiFooter/index.vue +++ b/src/components/GiFooter/index.vue @@ -5,9 +5,9 @@ diff --git a/src/components/GiSvgIcon/index.vue b/src/components/GiSvgIcon/index.vue index f6a6c67d..5b90a35c 100644 --- a/src/components/GiSvgIcon/index.vue +++ b/src/components/GiSvgIcon/index.vue @@ -3,7 +3,7 @@ aria-hidden="true" :class="svgClass" v-bind="$attrs" - :style="{ color: color, fill: color, width: iconSize, height: iconSize }" + :style="{ color, fill: color, width: iconSize, height: iconSize }" > @@ -12,21 +12,21 @@ diff --git a/src/views/home/components/AccessTrendCard.vue b/src/views/home/components/AccessTrendCard.vue index 74cf4f77..b2c9aa63 100644 --- a/src/views/home/components/AccessTrendCard.vue +++ b/src/views/home/components/AccessTrendCard.vue @@ -13,11 +13,28 @@ diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index c090525a..85d778d9 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -9,8 +9,8 @@ :loading="loading" :scroll="{ x: '100%', y: '100%', minWidth: 1000 }" :pagination="false" - :disabledTools="['size']" - :disabledColumnKeys="['name']" + :disabled-tools="['size']" + :disabled-column-keys="['name']" @refresh="search" > diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 50ecc4d2..46cda5a9 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -8,8 +8,8 @@ :loading="loading" :scroll="{ x: '100%', y: '100%', minWidth: 1000 }" :pagination="pagination" - :disabledTools="['size']" - :disabledColumnKeys="['name']" + :disabled-tools="['size']" + :disabled-column-keys="['name']" @refresh="search" > diff --git a/src/views/system/dict/item/index.vue b/src/views/system/dict/item/index.vue index 21dd351e..e340b476 100644 --- a/src/views/system/dict/item/index.vue +++ b/src/views/system/dict/item/index.vue @@ -1,7 +1,7 @@ diff --git a/src/views/system/role/RoleDetailDrawer.vue b/src/views/system/role/RoleDetailDrawer.vue index c968a52f..e7df1ad1 100644 --- a/src/views/system/role/RoleDetailDrawer.vue +++ b/src/views/system/role/RoleDetailDrawer.vue @@ -22,7 +22,6 @@ > diff --git a/src/views/system/storage/index.vue b/src/views/system/storage/index.vue index df043d81..8eaeb5de 100644 --- a/src/views/system/storage/index.vue +++ b/src/views/system/storage/index.vue @@ -8,8 +8,8 @@ :loading="loading" :scroll="{ x: '100%', y: '100%', minWidth: 1300 }" :pagination="pagination" - :disabledTools="['size']" - :disabledColumnKeys="['name']" + :disabled-tools="['size']" + :disabled-column-keys="['name']" @refresh="search" > diff --git a/src/views/system/user/UserDetailDrawer.vue b/src/views/system/user/UserDetailDrawer.vue index 54c367f6..e3f36fb5 100644 --- a/src/views/system/user/UserDetailDrawer.vue +++ b/src/views/system/user/UserDetailDrawer.vue @@ -27,8 +27,8 @@ diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index cf538f62..2eca35d0 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -19,15 +19,14 @@ diff --git a/src/views/tool/generator/GenPreviewModal.vue b/src/views/tool/generator/GenPreviewModal.vue index 07f7bda7..f802734f 100644 --- a/src/views/tool/generator/GenPreviewModal.vue +++ b/src/views/tool/generator/GenPreviewModal.vue @@ -39,9 +39,9 @@