From 3886cdfaa05ea70e5e81522b02737c339555556e Mon Sep 17 00:00:00 2001 From: Kirk Lin Date: Mon, 6 Nov 2023 15:37:58 +0800 Subject: [PATCH] style: migrate to new ESLint config format --- .eslintrc | 12 ----- apps/admin/src/apis/index.ts | 1 - .../src/composables/setting/useGlobSetting.ts | 4 +- apps/admin/src/directives/permission.ts | 4 +- .../components/IconButtonWithToolTip.vue | 3 +- .../header/components/LocaleSwitcher.vue | 4 +- .../header/components/UserInfoButton.vue | 4 +- apps/admin/src/layouts/menu/index.vue | 12 ++--- .../pages/internal/exception/Exception.vue | 2 +- .../src/pages/login/components/LoginForm.vue | 4 +- apps/admin/src/router/index.ts | 4 +- apps/admin/src/router/menus/index.ts | 4 +- apps/admin/src/router/routes/basic.ts | 3 +- apps/admin/src/router/routes/utils.ts | 6 +-- apps/admin/src/store/modules/user.ts | 2 +- apps/admin/src/store/plugin/persist.ts | 4 +- apps/admin/tsconfig.json | 2 +- apps/admin/types/shims-vue.d.ts | 2 +- eslint.config.js | 3 ++ package.json | 2 +- packages/node/tsconfig/tsconfig.base.json | 14 +++--- .../web/components/Icon/src/UnoCSSIcon.vue | 3 +- packages/web/constants/src/commonConstants.ts | 5 +- packages/web/hooks/src/useComponentRef.ts | 4 +- packages/web/locale/src/index.ts | 4 +- packages/web/request/src/axiosCancel.ts | 4 +- .../src/options/transform/defaultTransform.ts | 3 +- packages/web/request/src/utils.ts | 4 +- packages/web/types/src/shims-vue.d.ts | 2 +- packages/web/types/tsconfig.json | 4 +- .../web/utils/src/__test__/dateUtil.test.ts | 12 ++--- .../web/utils/src/__test__/deepMerge.test.ts | 16 +++---- .../web/utils/src/__test__/snowflake.test.ts | 4 +- .../web/utils/src/__test__/treeHelper.test.ts | 5 +- packages/web/utils/src/__test__/utils.test.ts | 8 ++-- packages/web/utils/src/browserHelper.ts | 10 ++-- packages/web/utils/src/domUtils.ts | 14 ++---- packages/web/utils/src/menuHelper.ts | 3 +- packages/web/utils/src/mock.ts | 42 ++++++----------- packages/web/utils/src/typeChecks.ts | 6 +-- packages/web/utils/src/util.ts | 5 +- packages/web/utils/src/vue/install.ts | 22 ++++----- packages/web/utils/tsconfig.json | 4 +- pnpm-lock.yaml | 47 +++++++++---------- scripts/src/directoryTreeOrganizer.ts | 12 ++--- services/admin/utils/mock.ts | 42 ++++++----------- services/admin/utils/user.ts | 4 +- 47 files changed, 165 insertions(+), 220 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 8f507007..00000000 --- a/.eslintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": [ - "@kirklin" - ], - "rules": { - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/no-unsafe-member-access": "off" - } -} diff --git a/apps/admin/src/apis/index.ts b/apps/admin/src/apis/index.ts index 829e2be8..d5cc7845 100644 --- a/apps/admin/src/apis/index.ts +++ b/apps/admin/src/apis/index.ts @@ -8,7 +8,6 @@ const vueQueryOptions: VueQueryPluginOptions = { queryClientConfig: { defaultOptions: { queries: { - cacheTime: 1000 * 60 * 60 * 24, staleTime: 1000 * 60 * 60 * 24, }, }, diff --git a/apps/admin/src/composables/setting/useGlobSetting.ts b/apps/admin/src/composables/setting/useGlobSetting.ts index fee52817..27f14812 100644 --- a/apps/admin/src/composables/setting/useGlobSetting.ts +++ b/apps/admin/src/composables/setting/useGlobSetting.ts @@ -1,7 +1,7 @@ import type { GlobConfig, GlobEnvConfig } from "@celeris/types"; import { getAppGlobalConfig } from "@celeris/utils"; -export const useGlobSetting = (): Readonly => { +export function useGlobSetting(): Readonly { const glob = getAppGlobalConfig(import.meta.env); return glob as Readonly; -}; +} diff --git a/apps/admin/src/directives/permission.ts b/apps/admin/src/directives/permission.ts index c0067a14..89347c02 100644 --- a/apps/admin/src/directives/permission.ts +++ b/apps/admin/src/directives/permission.ts @@ -17,9 +17,9 @@ function isAuth(el: Element, binding: any) { } } -const mounted = (el: Element, binding: DirectiveBinding) => { +function mounted(el: Element, binding: DirectiveBinding) { isAuth(el, binding); -}; +} const authDirective: Directive = { mounted, diff --git a/apps/admin/src/layouts/header/components/IconButtonWithToolTip.vue b/apps/admin/src/layouts/header/components/IconButtonWithToolTip.vue index 781528ce..e8ab6a17 100644 --- a/apps/admin/src/layouts/header/components/IconButtonWithToolTip.vue +++ b/apps/admin/src/layouts/header/components/IconButtonWithToolTip.vue @@ -2,7 +2,8 @@ import ToolTipper from "~/layouts/header/components/ToolTipper.vue"; withDefaults( - defineProps<{ tooltipText?: string;icon: string;color: string }>(), { + defineProps<{ tooltipText?: string;icon: string;color: string }>(), + { tooltipText: "icon Button", icon: "i-mdi-alert ", color: "gray", diff --git a/apps/admin/src/layouts/header/components/LocaleSwitcher.vue b/apps/admin/src/layouts/header/components/LocaleSwitcher.vue index d079b5d2..e510dabd 100644 --- a/apps/admin/src/layouts/header/components/LocaleSwitcher.vue +++ b/apps/admin/src/layouts/header/components/LocaleSwitcher.vue @@ -13,11 +13,11 @@ const options = computed( key: item, })), ); -const handleSelect = (key: string) => { +function handleSelect(key: string) { setProjectSetting({ locale: key }); locale.value = key; LocalesEngine.setLocale(key); -}; +}