perf: enable strict ts type checking (#4045)

This commit is contained in:
Vben
2024-08-05 21:12:22 +08:00
committed by GitHub
parent e5ec8e6b51
commit 4f5783d00b
41 changed files with 124 additions and 76 deletions

View File

@@ -1,8 +1,9 @@
<script setup lang="ts">
import type { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';
import { computed, type HTMLAttributes, useSlots } from 'vue';
import { VbenTooltip } from '@vben-core/shadcn-ui/components/tooltip';
import { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';
import { cn } from '@vben-core/shared';
import { type PrimitiveProps } from 'radix-vue';

View File

@@ -94,7 +94,7 @@ function formatNumber(num: number | string) {
const x2 = x.length > 1 ? decimal + x[1] : '';
const rgx = /(\d+)(\d{3})/;
if (separator && !isNumber(separator)) {
if (separator && !isNumber(separator) && x1) {
while (rgx.test(x1)) {
x1 = x1.replace(rgx, `$1${separator}$2`);
}

View File

@@ -1,7 +1,12 @@
<script setup lang="ts">
import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
import type {
HoverCardContentProps,
HoverCardRootEmits,
HoverCardRootProps,
} from 'radix-vue';
import { computed, HTMLAttributes } from 'vue';
import type { HTMLAttributes } from 'vue';
import { computed } from 'vue';
import {
HoverCard,
@@ -9,7 +14,7 @@ import {
HoverCardTrigger,
} from '@vben-core/shadcn-ui/components/ui/hover-card';
import { HoverCardContentProps, useForwardPropsEmits } from 'radix-vue';
import { useForwardPropsEmits } from 'radix-vue';
const props = defineProps<
{

View File

@@ -5,7 +5,8 @@ import type {
PopoverRootProps,
} from 'radix-vue';
import { computed, HTMLAttributes } from 'vue';
import type { HTMLAttributes } from 'vue';
import { computed } from 'vue';
import {
PopoverContent,

View File

@@ -6,7 +6,10 @@ defineOptions({
});
const props = withDefaults(
defineProps<{ content: Component | string; props?: Record<string, any> }>(),
defineProps<{
content: Component | string | undefined;
props?: Record<string, any>;
}>(),
{
props: () => ({}),
},

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { TooltipContentProps } from 'radix-vue';
import type { HTMLAttributes } from 'vue';
import {
@@ -8,8 +10,6 @@ import {
TooltipTrigger,
} from '@vben-core/shadcn-ui/components/ui/tooltip';
import { TooltipContentProps } from 'radix-vue';
interface Props {
contentClass?: HTMLAttributes['class'];
delayDuration?: number;