From ed27700ef487662ca21259b6fd2e395171c08ebc Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 22 Apr 2024 10:07:02 +0800 Subject: [PATCH] style: lint code --- components/_util/cssinjs/hooks/useCacheToken.tsx | 2 +- components/_util/hooks/_vueuse/_configurable.ts | 8 ++++---- components/_util/hooks/_vueuse/is.ts | 4 +--- components/tooltip/demo/arrow.vue | 1 + components/vc-select/TransBtn.tsx | 5 +++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/_util/cssinjs/hooks/useCacheToken.tsx b/components/_util/cssinjs/hooks/useCacheToken.tsx index 5463406d7..f97d146b5 100644 --- a/components/_util/cssinjs/hooks/useCacheToken.tsx +++ b/components/_util/cssinjs/hooks/useCacheToken.tsx @@ -14,7 +14,7 @@ const isPrerender = process.env.NODE_ENV === 'prerender'; // Generate different prefix to make user selector break in production env. // This helps developer not to do style override directly on the hash id. -const hashPrefix = (!isProduction && !isPrerender) ? 'css-dev-only-do-not-override' : 'css'; +const hashPrefix = !isProduction && !isPrerender ? 'css-dev-only-do-not-override' : 'css'; export interface Option { /** diff --git a/components/_util/hooks/_vueuse/_configurable.ts b/components/_util/hooks/_vueuse/_configurable.ts index 858fccc7d..a32d33939 100644 --- a/components/_util/hooks/_vueuse/_configurable.ts +++ b/components/_util/hooks/_vueuse/_configurable.ts @@ -28,7 +28,7 @@ export interface ConfigurableLocation { location?: Location; } -export const defaultWindow = isClient ? window : undefined; -export const defaultDocument = isClient ? window.document : undefined; -export const defaultNavigator = isClient ? window.navigator : undefined; -export const defaultLocation = isClient ? window.location : undefined; +export const defaultWindow = isClient ? window : undefined; +export const defaultDocument = isClient ? window.document : undefined; +export const defaultNavigator = isClient ? window.navigator : undefined; +export const defaultLocation = isClient ? window.location : undefined; diff --git a/components/_util/hooks/_vueuse/is.ts b/components/_util/hooks/_vueuse/is.ts index a17b11428..1acf122e8 100644 --- a/components/_util/hooks/_vueuse/is.ts +++ b/components/_util/hooks/_vueuse/is.ts @@ -21,8 +21,6 @@ export const rand = (min: number, max: number) => { return Math.floor(Math.random() * (max - min + 1)) + min; }; export const isIOS = - isClient && - window?.navigator?.userAgent && - /iP(ad|hone|od)/.test(window.navigator.userAgent); + isClient && window?.navigator?.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent); export const hasOwn = (val: T, key: K): key is K => Object.prototype.hasOwnProperty.call(val, key); diff --git a/components/tooltip/demo/arrow.vue b/components/tooltip/demo/arrow.vue index 3fe3f25d5..0edc66fc4 100644 --- a/components/tooltip/demo/arrow.vue +++ b/components/tooltip/demo/arrow.vue @@ -128,6 +128,7 @@ const mergedArrow = computed(() => { case 'hide': return false; case 'center': + default: return { pointAtCenter: true }; } }); diff --git a/components/vc-select/TransBtn.tsx b/components/vc-select/TransBtn.tsx index c29d3982c..f47e5dc6b 100644 --- a/components/vc-select/TransBtn.tsx +++ b/components/vc-select/TransBtn.tsx @@ -1,4 +1,5 @@ -import { cloneVNode, type FunctionalComponent, type PropType } from 'vue'; +import { cloneVNode } from 'vue'; +import type { VNode, FunctionalComponent, PropType } from 'vue'; import type { MouseEventHandler } from '../_util/EventInterface'; import type { VueNode } from '../_util/type'; import PropTypes from '../_util/vue-types'; @@ -23,7 +24,7 @@ const TransBtn: TransBtnType = (props, { slots }) => { if (typeof customizeIcon === 'function') { icon = customizeIcon(customizeIconProps); } else { - icon = cloneVNode(customizeIcon); + icon = cloneVNode(customizeIcon as VNode); } return (