From 23c590cafd9a3a37c3de42f1e0155033fd95342e Mon Sep 17 00:00:00 2001 From: Ryan SU Date: Wed, 13 Sep 2023 23:18:02 +0000 Subject: [PATCH 1/9] fix: cron expression --- .github/workflows/eslint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 38f939d4..ac26084e 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -2,11 +2,11 @@ name: ESLint on: push: - branches: ["master", "dev"] + branches: ['master', 'dev'] pull_request: - branches: ["master", "dev"] + branches: ['master', 'dev'] schedule: - - cron: '28 1 * * * 0' + - cron: '0 0 * * Mon' jobs: eslint: From 09b77c1c6dfc461327f6ff4d4c810851fa9cab00 Mon Sep 17 00:00:00 2001 From: Ryan SU Date: Wed, 13 Sep 2023 23:20:18 +0000 Subject: [PATCH 2/9] fix: eslint ci --- .github/workflows/eslint.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index ac26084e..60059ce3 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -21,6 +21,14 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install pnpm + run: npm install -g pnpm + - name: Install ESLint run: | pnpm install eslint@8.10.0 From 710991c42d8afe6b202e791867ee62717fb5f4a2 Mon Sep 17 00:00:00 2001 From: Ryan SU Date: Wed, 13 Sep 2023 23:22:43 +0000 Subject: [PATCH 3/9] fix: eslint ci --- .github/workflows/eslint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 60059ce3..a9dd0ede 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -31,8 +31,8 @@ jobs: - name: Install ESLint run: | - pnpm install eslint@8.10.0 - pnpm install @microsoft/eslint-formatter-sarif@2.1.7 + pnpm install -g eslint + pnpm install -g @microsoft/eslint-formatter-sarif - name: Run ESLint run: | From 92c7260f776ea96dd86bef3810f7d83ff5e9ec11 Mon Sep 17 00:00:00 2001 From: Ryan SU Date: Wed, 13 Sep 2023 23:26:29 +0000 Subject: [PATCH 4/9] fix: eslint ci --- .github/workflows/eslint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index a9dd0ede..8cb1e83d 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -31,8 +31,8 @@ jobs: - name: Install ESLint run: | - pnpm install -g eslint - pnpm install -g @microsoft/eslint-formatter-sarif + npm install -g eslint + npm install -g @microsoft/eslint-formatter-sarif - name: Run ESLint run: | From d093cae5c60fb78fb8f109781bcc7b72fb884bf8 Mon Sep 17 00:00:00 2001 From: Ryan SU Date: Wed, 13 Sep 2023 23:47:37 +0000 Subject: [PATCH 5/9] fix: lint the files --- mock/_createProductionServer.ts | 2 +- src/api/fms/storageProvider.ts | 10 ++++++++-- src/api/mcms/emailLog.ts | 8 +++++++- src/api/sys/model/menuModel.ts | 1 + .../Table/src/components/editable/EditableCell.vue | 2 +- src/components/VxeTable/src/VxeBasicTable.tsx | 3 +-- src/directives/ripple/index.ts | 1 + src/hooks/core/useAttrs.ts | 1 + src/hooks/web/useContextMenu.ts | 1 + src/hooks/web/useCopyToClipboard.ts | 1 + src/hooks/web/useECharts.ts | 3 +-- src/hooks/web/useI18n.ts | 2 +- src/layouts/default/feature/index.vue | 1 + src/layouts/default/header/components/FullScreen.vue | 8 ++------ src/layouts/default/setting/components/TypePicker.vue | 1 + src/layouts/default/sider/LayoutSider.vue | 1 + src/logics/mitt/routeChange.ts | 2 +- src/views/fms/storageProvider/index.vue | 10 +++++----- 18 files changed, 36 insertions(+), 22 deletions(-) diff --git a/mock/_createProductionServer.ts b/mock/_createProductionServer.ts index ae019982..b53ab30c 100644 --- a/mock/_createProductionServer.ts +++ b/mock/_createProductionServer.ts @@ -1,4 +1,4 @@ -import { createProdMockServer } from 'vite-plugin-mock/dist/client'; +import { createProdMockServer } from 'vite-plugin-mock/dist/client'; const modules: Record = import.meta.glob('./**/*.ts', { import: 'default', diff --git a/src/api/fms/storageProvider.ts b/src/api/fms/storageProvider.ts index 4e0491cd..713351ac 100644 --- a/src/api/fms/storageProvider.ts +++ b/src/api/fms/storageProvider.ts @@ -25,7 +25,10 @@ export const getStorageProviderList = (params: BaseListReq, mode: ErrorMessageMo /** * @description: Create a new storage provider */ -export const createStorageProvider = (params: StorageProviderInfo, mode: ErrorMessageMode = 'notice') => { +export const createStorageProvider = ( + params: StorageProviderInfo, + mode: ErrorMessageMode = 'notice', +) => { return defHttp.post( { url: Api.CreateStorageProvider, params: params }, { @@ -38,7 +41,10 @@ export const createStorageProvider = (params: StorageProviderInfo, mode: ErrorMe /** * @description: Update the storage provider */ -export const updateStorageProvider = (params: StorageProviderInfo, mode: ErrorMessageMode = 'notice') => { +export const updateStorageProvider = ( + params: StorageProviderInfo, + mode: ErrorMessageMode = 'notice', +) => { return defHttp.post( { url: Api.UpdateStorageProvider, params: params }, { diff --git a/src/api/mcms/emailLog.ts b/src/api/mcms/emailLog.ts index 3791782d..0fe59f77 100644 --- a/src/api/mcms/emailLog.ts +++ b/src/api/mcms/emailLog.ts @@ -1,6 +1,12 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; -import { BaseDataResp, BaseListReq, BaseResp, BaseUUIDsReq, BaseUUIDReq } from '/@/api/model/baseModel'; +import { + BaseDataResp, + BaseListReq, + BaseResp, + BaseUUIDsReq, + BaseUUIDReq, +} from '/@/api/model/baseModel'; import { EmailLogInfo, EmailLogListResp } from './model/emailLogModel'; enum Api { diff --git a/src/api/sys/model/menuModel.ts b/src/api/sys/model/menuModel.ts index b7eb67df..c7766006 100644 --- a/src/api/sys/model/menuModel.ts +++ b/src/api/sys/model/menuModel.ts @@ -1,5 +1,6 @@ import type { RouteMeta } from 'vue-router'; import { BaseListResp } from '../../model/baseModel'; + export interface RouteItem { path: string; component: any; diff --git a/src/components/Table/src/components/editable/EditableCell.vue b/src/components/Table/src/components/editable/EditableCell.vue index 75389f77..3c9d1de3 100644 --- a/src/components/Table/src/components/editable/EditableCell.vue +++ b/src/components/Table/src/components/editable/EditableCell.vue @@ -217,7 +217,7 @@ } if (isFunction(editRule)) { const res = await editRule(currentValue, record as Recordable); - if (!!res) { + if (res) { ruleMessage.value = res; ruleVisible.value = true; return false; diff --git a/src/components/VxeTable/src/VxeBasicTable.tsx b/src/components/VxeTable/src/VxeBasicTable.tsx index 17af5a49..cf78029b 100644 --- a/src/components/VxeTable/src/VxeBasicTable.tsx +++ b/src/components/VxeTable/src/VxeBasicTable.tsx @@ -1,5 +1,4 @@ -import { defineComponent } from 'vue'; -import { computed, ref } from 'vue'; +import { defineComponent, computed, ref } from 'vue'; import { BasicTableProps } from './types'; import { basicProps } from './props'; import { ignorePropKeys } from './const'; diff --git a/src/directives/ripple/index.ts b/src/directives/ripple/index.ts index 85a80e8f..3da8014e 100644 --- a/src/directives/ripple/index.ts +++ b/src/directives/ripple/index.ts @@ -1,5 +1,6 @@ import type { Directive } from 'vue'; import './index.less'; + export interface RippleOptions { event: string; transition: number; diff --git a/src/hooks/core/useAttrs.ts b/src/hooks/core/useAttrs.ts index a7c5bd74..ea965758 100644 --- a/src/hooks/core/useAttrs.ts +++ b/src/hooks/core/useAttrs.ts @@ -1,5 +1,6 @@ import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue'; import type { Ref } from 'vue'; + interface Params { excludeListeners?: boolean; excludeKeys?: string[]; diff --git a/src/hooks/web/useContextMenu.ts b/src/hooks/web/useContextMenu.ts index d3c53ce6..3237d35c 100644 --- a/src/hooks/web/useContextMenu.ts +++ b/src/hooks/web/useContextMenu.ts @@ -1,6 +1,7 @@ import { onUnmounted, getCurrentInstance } from 'vue'; import { createContextMenu, destroyContextMenu } from '/@/components/ContextMenu'; import type { ContextMenuItem } from '/@/components/ContextMenu'; + export type { ContextMenuItem }; export function useContextMenu(authRemove = true) { if (getCurrentInstance() && authRemove) { diff --git a/src/hooks/web/useCopyToClipboard.ts b/src/hooks/web/useCopyToClipboard.ts index 69abf26d..5072f9cd 100644 --- a/src/hooks/web/useCopyToClipboard.ts +++ b/src/hooks/web/useCopyToClipboard.ts @@ -1,6 +1,7 @@ import { ref, watch } from 'vue'; import { isDef } from '/@/utils/is'; + interface Options { target?: HTMLElement; } diff --git a/src/hooks/web/useECharts.ts b/src/hooks/web/useECharts.ts index 6324e4a9..1ed3d635 100644 --- a/src/hooks/web/useECharts.ts +++ b/src/hooks/web/useECharts.ts @@ -1,9 +1,8 @@ import type { EChartsOption } from 'echarts'; import type { Ref } from 'vue'; import { useTimeoutFn } from '/@/hooks/core/useTimeout'; -import { tryOnUnmounted } from '@vueuse/core'; +import { tryOnUnmounted, useDebounceFn } from '@vueuse/core'; import { unref, nextTick, watch, computed, ref } from 'vue'; -import { useDebounceFn } from '@vueuse/core'; import { useEventListener } from '/@/hooks/event/useEventListener'; import { useBreakpoint } from '/@/hooks/event/useBreakpoint'; import echarts from '/@/utils/lib/echarts'; diff --git a/src/hooks/web/useI18n.ts b/src/hooks/web/useI18n.ts index a54c8a53..2a777b78 100644 --- a/src/hooks/web/useI18n.ts +++ b/src/hooks/web/useI18n.ts @@ -18,7 +18,7 @@ function getKey(namespace: string | undefined, key: string) { if (key.startsWith(namespace)) { return key; } - return `${name-space}.${key}`; + return `${namespace}.${key}`; } export function useI18n(namespace?: string): { diff --git a/src/layouts/default/feature/index.vue b/src/layouts/default/feature/index.vue index 241a5263..9a20bb17 100644 --- a/src/layouts/default/feature/index.vue +++ b/src/layouts/default/feature/index.vue @@ -11,6 +11,7 @@ import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; import SessionTimeoutLogin from '/@/views/sys/login/SessionTimeoutLogin.vue'; + export default defineComponent({ name: 'LayoutFeatures', components: { diff --git a/src/layouts/default/header/components/FullScreen.vue b/src/layouts/default/header/components/FullScreen.vue index 1304e8cf..5e083164 100644 --- a/src/layouts/default/header/components/FullScreen.vue +++ b/src/layouts/default/header/components/FullScreen.vue @@ -13,6 +13,7 @@ import { useFullscreen } from '@vueuse/core'; import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons-vue'; + export default defineComponent({ name: 'FullScreen', components: { FullscreenExitOutlined, FullscreenOutlined, Tooltip }, @@ -21,12 +22,7 @@ const { t } = useI18n(); const { toggle, isFullscreen } = useFullscreen(); // 重新检查全屏状态 - isFullscreen.value = !!( - document.fullscreenElement || - document.webkitFullscreenElement || - document.mozFullScreenElement || - document.msFullscreenElement - ); + isFullscreen.value = !!document.fullscreenElement; const getTitle = computed(() => { return unref(isFullscreen) diff --git a/src/layouts/default/setting/components/TypePicker.vue b/src/layouts/default/setting/components/TypePicker.vue index f0d00978..5a86f78b 100644 --- a/src/layouts/default/setting/components/TypePicker.vue +++ b/src/layouts/default/setting/components/TypePicker.vue @@ -25,6 +25,7 @@ import { useDesign } from '/@/hooks/web/useDesign'; import { menuTypeList } from '../enum'; + export default defineComponent({ name: 'MenuTypePicker', components: { Tooltip }, diff --git a/src/layouts/default/sider/LayoutSider.vue b/src/layouts/default/sider/LayoutSider.vue index 9ada6654..0a64cee4 100644 --- a/src/layouts/default/sider/LayoutSider.vue +++ b/src/layouts/default/sider/LayoutSider.vue @@ -40,6 +40,7 @@ import { useDesign } from '/@/hooks/web/useDesign'; import DragBar from './DragBar.vue'; + export default defineComponent({ name: 'LayoutSideBar', components: { Sider: Layout.Sider, LayoutMenu, DragBar, LayoutTrigger }, diff --git a/src/logics/mitt/routeChange.ts b/src/logics/mitt/routeChange.ts index 96bdaa01..0dc21099 100644 --- a/src/logics/mitt/routeChange.ts +++ b/src/logics/mitt/routeChange.ts @@ -2,7 +2,7 @@ * Used to monitor routing changes to change the status of menus and tabs. There is no need to monitor the route, because the route status change is affected by the page rendering time, which will be slow */ -import {Handler, mitt} from '/@/utils/mitt'; +import { Handler, mitt } from '/@/utils/mitt'; import type { RouteLocationNormalized } from 'vue-router'; import { getRawRoute } from '/@/utils'; diff --git a/src/views/fms/storageProvider/index.vue b/src/views/fms/storageProvider/index.vue index 25f02a44..a067cf47 100644 --- a/src/views/fms/storageProvider/index.vue +++ b/src/views/fms/storageProvider/index.vue @@ -3,11 +3,11 @@