chore(biome): turn on style.useImportType (#55104)

This commit is contained in:
thinkasany
2025-09-21 10:33:31 +08:00
committed by GitHub
parent 9d07df9667
commit 030783f41b
20 changed files with 29 additions and 20 deletions

View File

@@ -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 {

View File

@@ -1,4 +1,4 @@
import { Project, ProjectFiles } from '@stackblitz/sdk';
import type { Project, ProjectFiles } from '@stackblitz/sdk';
const getStackblitzConfig = ({
title = '',

View File

@@ -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';

View File

@@ -40,7 +40,6 @@
"linter": {
"rules": {
"style": {
"useImportType": "off",
"useNumberNamespace": "off",
"useNodejsImportProtocol": "off",
"noNonNullAssertion": "off",

View File

@@ -1,7 +1,7 @@
import * as React from 'react';
import classnames from 'classnames';
import { ValidChar } from './interface';
import type { ValidChar } from './interface';
type TemplateSemanticClassNames<T extends string> = Partial<Record<T, string>>;

View File

@@ -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';

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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';

View File

@@ -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;

View File

@@ -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;

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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) => (
<Splitter {...props}>

View File

@@ -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) {