From 030783f41b2053dcd454a22b41e037a071a235db Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Sun, 21 Sep 2025 10:33:31 +0800 Subject: [PATCH] chore(biome): turn on style.useImportType (#55104) --- .dumi/theme/builtins/Badge/index.tsx | 3 ++- .dumi/theme/builtins/Previewer/stackblitzConfig.ts | 2 +- .dumi/theme/builtins/RefinedChangelog/index.tsx | 3 ++- biome.json | 1 - components/_util/hooks/useMergeSemantic/index.ts | 2 +- components/card/__tests__/index.test.tsx | 2 +- components/date-picker/demo/external-panel.tsx | 3 ++- components/divider/index.tsx | 2 +- components/form/__tests__/ref.test.tsx | 3 ++- components/input/Input.tsx | 3 ++- components/list/demo/drag-sorting-handler.tsx | 3 ++- components/list/demo/grid-drag-sorting-handler.tsx | 3 ++- components/locale/__tests__/index.test.tsx | 2 +- components/modal/Modal.tsx | 2 +- components/modal/__tests__/confirm.test.tsx | 3 ++- components/modal/__tests__/hook.test.tsx | 3 ++- components/modal/confirm.tsx | 3 ++- components/modal/interface.ts | 2 +- components/splitter/__tests__/lazy.test.tsx | 2 +- components/tooltip/util.ts | 2 +- 20 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.dumi/theme/builtins/Badge/index.tsx b/.dumi/theme/builtins/Badge/index.tsx index c01befa96a..2a68303e0b 100644 --- a/.dumi/theme/builtins/Badge/index.tsx +++ b/.dumi/theme/builtins/Badge/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { Tag, TagProps } from 'antd'; +import { Tag } from 'antd'; +import type { TagProps } from 'antd'; // https://github.com/umijs/dumi/blob/master/src/client/theme-default/builtins/Badge/index.tsx interface BadgeProps extends TagProps { diff --git a/.dumi/theme/builtins/Previewer/stackblitzConfig.ts b/.dumi/theme/builtins/Previewer/stackblitzConfig.ts index 22233ee81a..005705d8e5 100644 --- a/.dumi/theme/builtins/Previewer/stackblitzConfig.ts +++ b/.dumi/theme/builtins/Previewer/stackblitzConfig.ts @@ -1,4 +1,4 @@ -import { Project, ProjectFiles } from '@stackblitz/sdk'; +import type { Project, ProjectFiles } from '@stackblitz/sdk'; const getStackblitzConfig = ({ title = '', diff --git a/.dumi/theme/builtins/RefinedChangelog/index.tsx b/.dumi/theme/builtins/RefinedChangelog/index.tsx index 7a58ef81af..b67cad00d6 100644 --- a/.dumi/theme/builtins/RefinedChangelog/index.tsx +++ b/.dumi/theme/builtins/RefinedChangelog/index.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import { BugOutlined } from '@ant-design/icons'; import { Button, Flex, Popover, theme } from 'antd'; import { createStyles } from 'antd-style'; -import dayjs, { Dayjs } from 'dayjs'; +import dayjs from 'dayjs'; +import type { Dayjs } from 'dayjs'; import useLocale from '../../../hooks/useLocale'; import { matchDeprecated } from '../../utils'; diff --git a/biome.json b/biome.json index 885434502f..3112653f1c 100644 --- a/biome.json +++ b/biome.json @@ -40,7 +40,6 @@ "linter": { "rules": { "style": { - "useImportType": "off", "useNumberNamespace": "off", "useNodejsImportProtocol": "off", "noNonNullAssertion": "off", diff --git a/components/_util/hooks/useMergeSemantic/index.ts b/components/_util/hooks/useMergeSemantic/index.ts index 03c3ba43f9..fe84451f43 100644 --- a/components/_util/hooks/useMergeSemantic/index.ts +++ b/components/_util/hooks/useMergeSemantic/index.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import classnames from 'classnames'; -import { ValidChar } from './interface'; +import type { ValidChar } from './interface'; type TemplateSemanticClassNames = Partial>; diff --git a/components/card/__tests__/index.test.tsx b/components/card/__tests__/index.test.tsx index 55cf532ebc..fa6dfab600 100644 --- a/components/card/__tests__/index.test.tsx +++ b/components/card/__tests__/index.test.tsx @@ -2,7 +2,7 @@ import '@testing-library/jest-dom'; import React from 'react'; import userEvent from '@testing-library/user-event'; -import { TabBarExtraContent } from 'rc-tabs/lib/interface'; +import type { TabBarExtraContent } from 'rc-tabs/lib/interface'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/date-picker/demo/external-panel.tsx b/components/date-picker/demo/external-panel.tsx index b332e40cb0..a44ede704e 100644 --- a/components/date-picker/demo/external-panel.tsx +++ b/components/date-picker/demo/external-panel.tsx @@ -1,7 +1,8 @@ import React from 'react'; import { DownOutlined } from '@ant-design/icons'; import { DatePicker, Dropdown, Space } from 'antd'; -import dayjs, { Dayjs } from 'dayjs'; +import dayjs from 'dayjs'; +import type { Dayjs } from 'dayjs'; const DatePickerDemo: React.FC = () => { const [visible, setVisible] = React.useState(false); diff --git a/components/divider/index.tsx b/components/divider/index.tsx index 953f93bec5..c59c4ae0f8 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { devUseWarning } from '../_util/warning'; import { useComponentConfig } from '../config-provider/context'; import useSize from '../config-provider/hooks/useSize'; -import { SizeType } from '../config-provider/SizeContext'; +import type { SizeType } from '../config-provider/SizeContext'; import useStyle from './style'; export interface DividerProps { diff --git a/components/form/__tests__/ref.test.tsx b/components/form/__tests__/ref.test.tsx index 9cd40a2cb8..e1a763bf50 100644 --- a/components/form/__tests__/ref.test.tsx +++ b/components/form/__tests__/ref.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; import type { FormRef } from 'rc-field-form/lib/interface'; -import Form, { FormInstance } from '..'; +import Form from '..'; +import type { FormInstance } from '..'; import { fireEvent, render } from '../../../tests/utils'; import Button from '../../button'; import type { InputRef } from '../../input'; diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 439e7be6d7..0e327733ee 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -2,7 +2,8 @@ import React, { forwardRef, useContext, useEffect, useRef } from 'react'; import cls from 'classnames'; import type { InputRef, InputProps as RcInputProps } from 'rc-input'; import RcInput from 'rc-input'; -import { InputFocusOptions, triggerFocus } from 'rc-input/lib/utils/commonUtils'; +import { triggerFocus } from 'rc-input/lib/utils/commonUtils'; +import type { InputFocusOptions } from 'rc-input/lib/utils/commonUtils'; import { composeRef } from 'rc-util/lib/ref'; import ContextIsolator from '../_util/ContextIsolator'; diff --git a/components/list/demo/drag-sorting-handler.tsx b/components/list/demo/drag-sorting-handler.tsx index 240fc05932..3014f05927 100644 --- a/components/list/demo/drag-sorting-handler.tsx +++ b/components/list/demo/drag-sorting-handler.tsx @@ -11,7 +11,8 @@ import { verticalListSortingStrategy, } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import { Button, GetProps, List } from 'antd'; +import { Button, List } from 'antd'; +import type { GetProps } from 'antd'; interface SortableListItemContextProps { setActivatorNodeRef?: (element: HTMLElement | null) => void; diff --git a/components/list/demo/grid-drag-sorting-handler.tsx b/components/list/demo/grid-drag-sorting-handler.tsx index d7af895fad..ee6a3819a1 100644 --- a/components/list/demo/grid-drag-sorting-handler.tsx +++ b/components/list/demo/grid-drag-sorting-handler.tsx @@ -5,7 +5,8 @@ import { DndContext } from '@dnd-kit/core'; import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities'; import { arrayMove, SortableContext, useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import { Button, Card, GetProps, List } from 'antd'; +import { Button, Card, List } from 'antd'; +import type { GetProps } from 'antd'; interface SortableListItemContextProps { setActivatorNodeRef?: (element: HTMLElement | null) => void; diff --git a/components/locale/__tests__/index.test.tsx b/components/locale/__tests__/index.test.tsx index cc3a170c87..1c7e1d0957 100644 --- a/components/locale/__tests__/index.test.tsx +++ b/components/locale/__tests__/index.test.tsx @@ -80,10 +80,10 @@ import { Popconfirm, Select, Table, - TableProps, TimePicker, Transfer, } from '../..'; +import type { TableProps } from '../..'; import mountTest from '../../../tests/shared/mountTest'; import { render } from '../../../tests/utils'; import arEG from '../../locale/ar_EG'; diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 65a3aa74cf..dacf43a6fb 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -8,7 +8,7 @@ import ContextIsolator from '../_util/ContextIsolator'; import useClosable, { pickClosable } from '../_util/hooks/useClosable'; import { useZIndex } from '../_util/hooks/useZIndex'; import { getTransitionName } from '../_util/motion'; -import { Breakpoint } from '../_util/responsiveObserver'; +import type { Breakpoint } from '../_util/responsiveObserver'; import { canUseDocElement } from '../_util/styleChecker'; import { devUseWarning } from '../_util/warning'; import zIndexContext from '../_util/zindexContext'; diff --git a/components/modal/__tests__/confirm.test.tsx b/components/modal/__tests__/confirm.test.tsx index 04b67e4c37..124774d4c7 100644 --- a/components/modal/__tests__/confirm.test.tsx +++ b/components/modal/__tests__/confirm.test.tsx @@ -6,7 +6,8 @@ import { resetWarned } from 'rc-util/lib/warning'; import type { ModalFuncProps } from '..'; import Modal from '..'; import { act, fireEvent, waitFakeTimer } from '../../../tests/utils'; -import ConfigProvider, { defaultPrefixCls, GlobalConfigProps } from '../../config-provider'; +import ConfigProvider, { defaultPrefixCls } from '../../config-provider'; +import type { GlobalConfigProps } from '../../config-provider'; import type { ModalFunc } from '../confirm'; import destroyFns from '../destroyFns'; diff --git a/components/modal/__tests__/hook.test.tsx b/components/modal/__tests__/hook.test.tsx index 27999242a9..cab8aa67a4 100644 --- a/components/modal/__tests__/hook.test.tsx +++ b/components/modal/__tests__/hook.test.tsx @@ -4,7 +4,8 @@ import KeyCode from 'rc-util/lib/KeyCode'; import Modal from '..'; import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import Button from '../../button'; -import ConfigProvider, { ConfigProviderProps } from '../../config-provider'; +import ConfigProvider from '../../config-provider'; +import type { ConfigProviderProps } from '../../config-provider'; import Input from '../../input'; import zhCN from '../../locale/zh_CN'; import type { ModalFunc } from '../confirm'; diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index 41844aa12f..38c86d300e 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -2,7 +2,8 @@ import React, { useContext } from 'react'; import warning from '../_util/warning'; import ConfigProvider, { ConfigContext, globalConfig, warnContext } from '../config-provider'; -import { unstableSetRender, UnmountType } from '../config-provider/UnstableContext'; +import { unstableSetRender } from '../config-provider/UnstableContext'; +import type { UnmountType } from '../config-provider/UnstableContext'; import type { ConfirmDialogProps } from './ConfirmDialog'; import ConfirmDialog from './ConfirmDialog'; import destroyFns from './destroyFns'; diff --git a/components/modal/interface.ts b/components/modal/interface.ts index d6d69b26f9..f90d74aee6 100644 --- a/components/modal/interface.ts +++ b/components/modal/interface.ts @@ -1,7 +1,7 @@ import type React from 'react'; import type { DialogProps } from 'rc-dialog'; -import { Breakpoint } from '../_util/responsiveObserver'; +import type { Breakpoint } from '../_util/responsiveObserver'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import type { DirectionType } from '../config-provider'; diff --git a/components/splitter/__tests__/lazy.test.tsx b/components/splitter/__tests__/lazy.test.tsx index 7126d323de..39f5ba01d5 100644 --- a/components/splitter/__tests__/lazy.test.tsx +++ b/components/splitter/__tests__/lazy.test.tsx @@ -5,7 +5,7 @@ import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; import { resetWarned } from 'rc-util/lib/warning'; import { triggerResize, waitFakeTimer } from '../../../tests/utils'; -import { PanelProps, SplitterProps } from '../interface'; +import type { PanelProps, SplitterProps } from '../interface'; const SplitterDemo = ({ items = [{}, {}], ...props }: { items?: PanelProps[] } & SplitterProps) => ( diff --git a/components/tooltip/util.ts b/components/tooltip/util.ts index ed25842b51..92672ac770 100644 --- a/components/tooltip/util.ts +++ b/components/tooltip/util.ts @@ -2,7 +2,7 @@ import type * as React from 'react'; import classNames from 'classnames'; import { isPresetColor } from '../_util/colors'; -import { ColorGenInput } from '../color-picker/interface'; +import type { ColorGenInput } from '../color-picker/interface'; import { generateColor } from '../color-picker/util'; export function parseColor(prefixCls: string, color?: string) {