diff --git a/.dumi/rehypeAntd.ts b/.dumi/rehypeAntd.ts index 8f10bf4d84..1cecbf93d3 100644 --- a/.dumi/rehypeAntd.ts +++ b/.dumi/rehypeAntd.ts @@ -1,5 +1,6 @@ import assert from 'assert'; -import { unistUtilVisit, type HastRoot, type UnifiedTransformer } from 'dumi'; +import type { HastRoot, UnifiedTransformer } from 'dumi'; +import { unistUtilVisit } from 'dumi'; /** * plugin for modify hast tree when docs compiling diff --git a/.dumi/theme/builtins/ColorChunk/index.tsx b/.dumi/theme/builtins/ColorChunk/index.tsx index 1516f52b20..2ec5e65719 100644 --- a/.dumi/theme/builtins/ColorChunk/index.tsx +++ b/.dumi/theme/builtins/ColorChunk/index.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { TinyColor, type ColorInput } from '@ctrl/tinycolor'; +import type { ColorInput } from '@ctrl/tinycolor'; +import { TinyColor } from '@ctrl/tinycolor'; import { createStyles } from 'antd-style'; interface ColorChunkProps { diff --git a/.dumi/theme/builtins/ComponentMeta/index.tsx b/.dumi/theme/builtins/ComponentMeta/index.tsx index febf298133..3b4600b716 100644 --- a/.dumi/theme/builtins/ComponentMeta/index.tsx +++ b/.dumi/theme/builtins/ComponentMeta/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { EditOutlined, GithubOutlined } from '@ant-design/icons'; -import { Descriptions, theme, Tooltip, Typography, type GetProp } from 'antd'; +import type { GetProp } from 'antd'; +import { Descriptions, theme, Tooltip, Typography } from 'antd'; import { createStyles, css } from 'antd-style'; import kebabCase from 'lodash/kebabCase'; import CopyToClipboard from 'react-copy-to-clipboard'; diff --git a/.dumi/theme/builtins/Container/index.tsx b/.dumi/theme/builtins/Container/index.tsx index 6ba249cd4a..20835fd217 100644 --- a/.dumi/theme/builtins/Container/index.tsx +++ b/.dumi/theme/builtins/Container/index.tsx @@ -2,7 +2,7 @@ * copied: https://github.com/arvinxx/dumi-theme-antd-style/tree/master/src/builtins/Container */ import * as React from 'react'; -import { type FC, type ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { Alert } from 'antd'; import useStyles from './style'; diff --git a/.dumi/theme/common/CodePreview.tsx b/.dumi/theme/common/CodePreview.tsx index 13a06b5d00..a0b7e77271 100644 --- a/.dumi/theme/common/CodePreview.tsx +++ b/.dumi/theme/common/CodePreview.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useMemo, type ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { Button, Tabs, Typography } from 'antd'; import { createStyles } from 'antd-style'; import toReactElement from 'jsonml-to-react-element'; @@ -120,7 +121,7 @@ const CodePreview: React.FC = ({ style: Prism.highlight(styleCode, Prism.languages.css, 'css'), }; // 去掉空的代码类型 - Object.keys(codes).forEach((key: keyof typeof codes) => { + (Object.keys(codes) as (keyof typeof codes)[]).forEach((key) => { if (!codes[key]) { delete codes[key]; } diff --git a/.dumi/tsconfig.json b/.dumi/tsconfig.json index 74eb1d4439..9b3a94dc31 100644 --- a/.dumi/tsconfig.json +++ b/.dumi/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "resolveJsonModule": true }, - "include": ["**/*"] + "include": ["**/*", "../typings/index.d.ts"] } diff --git a/.eslintrc.js b/.eslintrc.js index d83981359c..c127ffed43 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -44,6 +44,7 @@ module.exports = { 'no-unused-expressions': 'off', '@typescript-eslint/no-unused-expressions': 2, '@typescript-eslint/consistent-type-imports': [2, { disallowTypeAnnotations: false }], + 'import/consistent-type-specifier-style': 2, }, }, { diff --git a/.prettierignore b/.prettierignore index cfadc2c091..6c9df7e674 100644 --- a/.prettierignore +++ b/.prettierignore @@ -31,3 +31,4 @@ components/*/*.jsx .eslintignore .history **/*.yml +*.html \ No newline at end of file diff --git a/components/__tests__/setup.test.tsx b/components/__tests__/setup.test.tsx index f555f13ee6..a054334ba4 100644 --- a/components/__tests__/setup.test.tsx +++ b/components/__tests__/setup.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import { render } from '../../tests/utils'; describe('SetUp.Test', () => { diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index 1da49483d3..b0dd28c11f 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -1,5 +1,6 @@ -import useState from 'rc-util/lib/hooks/useState'; import * as React from 'react'; +import useState from 'rc-util/lib/hooks/useState'; + import Button from '../button'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import { convertLegacyProps } from '../button/buttonHelpers'; diff --git a/components/_util/__tests__/responsiveObserve.test.tsx b/components/_util/__tests__/responsiveObserve.test.tsx index d88c5ea606..effc2570ec 100644 --- a/components/_util/__tests__/responsiveObserve.test.tsx +++ b/components/_util/__tests__/responsiveObserve.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { render } from '../../../tests/utils'; import useResponsiveObserver from '../responsiveObserver'; diff --git a/components/_util/__tests__/transButton.test.tsx b/components/_util/__tests__/transButton.test.tsx index 6f1fef1fe5..41806b843d 100644 --- a/components/_util/__tests__/transButton.test.tsx +++ b/components/_util/__tests__/transButton.test.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import TransButton from '../transButton'; + import { render } from '../../../tests/utils'; +import TransButton from '../transButton'; describe('transButton component', () => { it('disabled should update style', () => { diff --git a/components/_util/__tests__/useSyncState.test.tsx b/components/_util/__tests__/useSyncState.test.tsx index b0c0d96971..3ba9241567 100644 --- a/components/_util/__tests__/useSyncState.test.tsx +++ b/components/_util/__tests__/useSyncState.test.tsx @@ -1,6 +1,7 @@ import React from 'react'; + +import { fireEvent, render } from '../../../tests/utils'; import useSyncState from '../hooks/useSyncState'; -import { render, fireEvent } from '../../../tests/utils'; describe('Table', () => { it('useSyncState', () => { diff --git a/components/_util/__tests__/util.test.tsx b/components/_util/__tests__/util.test.tsx index 6b80428474..8fef3c6403 100644 --- a/components/_util/__tests__/util.test.tsx +++ b/components/_util/__tests__/util.test.tsx @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ -import KeyCode from 'rc-util/lib/KeyCode'; import React from 'react'; +import KeyCode from 'rc-util/lib/KeyCode'; + import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import { isStyleSupport } from '../styleChecker'; import throttleByAnimationFrame from '../throttleByAnimationFrame'; diff --git a/components/_util/__tests__/warning.test.tsx b/components/_util/__tests__/warning.test.tsx index 9c85ae405b..2772592ed7 100644 --- a/components/_util/__tests__/warning.test.tsx +++ b/components/_util/__tests__/warning.test.tsx @@ -1,5 +1,6 @@ -import { render } from '@testing-library/react'; import React from 'react'; +import { render } from '@testing-library/react'; + import { devUseWarning as useWarning } from '../warning'; describe('Test warning', () => { diff --git a/components/_util/__tests__/wave.test.tsx b/components/_util/__tests__/wave.test.tsx index 0f6bd7ec2d..48f3db0529 100644 --- a/components/_util/__tests__/wave.test.tsx +++ b/components/_util/__tests__/wave.test.tsx @@ -1,10 +1,11 @@ import React from 'react'; import classNames from 'classnames'; + import mountTest from '../../../tests/shared/mountTest'; import { act, fireEvent, getByText, render, waitFakeTimer } from '../../../tests/utils'; +import Checkbox from '../../checkbox'; import Wave from '../wave'; import { TARGET_CLS } from '../wave/interface'; -import Checkbox from '../../checkbox'; (global as any).isVisible = true; diff --git a/components/_util/colors.ts b/components/_util/colors.ts index 5c21c663cc..5fe27ca7a0 100644 --- a/components/_util/colors.ts +++ b/components/_util/colors.ts @@ -14,7 +14,7 @@ export const PresetStatusColorTypes = [ export type PresetColorType = PresetColorKey | InverseColor; -export type PresetStatusColorType = typeof PresetStatusColorTypes[number]; +export type PresetStatusColorType = (typeof PresetStatusColorTypes)[number]; /** * determine if the color keyword belongs to the `Ant Design` {@link PresetColors}. diff --git a/components/_util/hooks/useProxyImperativeHandle.ts b/components/_util/hooks/useProxyImperativeHandle.ts index 849630cbcf..18691e845b 100644 --- a/components/_util/hooks/useProxyImperativeHandle.ts +++ b/components/_util/hooks/useProxyImperativeHandle.ts @@ -1,7 +1,8 @@ // Proxy the dom ref with `{ nativeElement, otherFn }` type // ref: https://github.com/ant-design/ant-design/discussions/45242 -import { useImperativeHandle, type Ref } from 'react'; +import { useImperativeHandle } from 'react'; +import type { Ref } from 'react'; function fillProxy( element: HTMLElement & { _antProxy?: Record }, diff --git a/components/_util/motion.ts b/components/_util/motion.ts index 7156f26b8d..474ccc8e65 100644 --- a/components/_util/motion.ts +++ b/components/_util/motion.ts @@ -27,7 +27,7 @@ const initCollapseMotion = (rootCls: string = 'ant'): CSSMotionProps => ({ const SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const; -export type SelectCommonPlacement = typeof SelectPlacements[number]; +export type SelectCommonPlacement = (typeof SelectPlacements)[number]; const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => { if (transitionName !== undefined) { diff --git a/components/_util/scrollTo.ts b/components/_util/scrollTo.ts index fb6141cd5b..e0fcda95e3 100644 --- a/components/_util/scrollTo.ts +++ b/components/_util/scrollTo.ts @@ -1,4 +1,5 @@ import raf from 'rc-util/lib/raf'; + import { easeInOutCubic } from './easings'; import getScroll, { isWindow } from './getScroll'; diff --git a/components/_util/statusUtils.ts b/components/_util/statusUtils.ts index 08358b6ab2..43113b3510 100644 --- a/components/_util/statusUtils.ts +++ b/components/_util/statusUtils.ts @@ -1,9 +1,10 @@ import classNames from 'classnames'; + import type { ValidateStatus } from '../form/FormItem'; const InputStatuses = ['warning', 'error', ''] as const; -export type InputStatus = typeof InputStatuses[number]; +export type InputStatus = (typeof InputStatuses)[number]; export function getStatusClassNames( prefixCls: string, diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index 73a9f9906a..942691e902 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -3,8 +3,8 @@ * * This helps accessibility reader to tread as a interactive button to operation. */ -import KeyCode from 'rc-util/lib/KeyCode'; import * as React from 'react'; +import KeyCode from 'rc-util/lib/KeyCode'; interface TransButtonProps extends React.HTMLAttributes { onClick?: (e?: React.MouseEvent) => void; diff --git a/components/_util/wave/WaveEffect.tsx b/components/_util/wave/WaveEffect.tsx index 09aaef316f..a3895c3473 100644 --- a/components/_util/wave/WaveEffect.tsx +++ b/components/_util/wave/WaveEffect.tsx @@ -4,7 +4,8 @@ import CSSMotion from 'rc-motion'; import raf from 'rc-util/lib/raf'; import { render, unmount } from 'rc-util/lib/React/render'; -import { TARGET_CLS, type ShowWaveEffect } from './interface'; +import { TARGET_CLS } from './interface'; +import type { ShowWaveEffect } from './interface'; import { getTargetWaveColor } from './util'; function validateNum(value: number) { diff --git a/components/_util/wave/useWave.ts b/components/_util/wave/useWave.ts index e18c01c292..57469674c7 100644 --- a/components/_util/wave/useWave.ts +++ b/components/_util/wave/useWave.ts @@ -4,7 +4,8 @@ import raf from 'rc-util/lib/raf'; import { ConfigContext } from '../../config-provider'; import useToken from '../../theme/useToken'; -import { TARGET_CLS, type ShowWave } from './interface'; +import { TARGET_CLS } from './interface'; +import type { ShowWave } from './interface'; import showWaveEffect from './WaveEffect'; const useWave = ( diff --git a/components/alert/Alert.tsx b/components/alert/Alert.tsx index 993ef56747..21cb5f0dee 100644 --- a/components/alert/Alert.tsx +++ b/components/alert/Alert.tsx @@ -9,11 +9,11 @@ import classNames from 'classnames'; import CSSMotion from 'rc-motion'; import pickAttrs from 'rc-util/lib/pickAttrs'; +import type { ClosableType } from '../_util/hooks/useClosable'; import { replaceElement } from '../_util/reactNode'; import { devUseWarning } from '../_util/warning'; import { ConfigContext } from '../config-provider'; import useStyle from './style'; -import type { ClosableType } from '../_util/hooks/useClosable'; export interface AlertProps { /** Type of Alert styles, options:`success`, `info`, `warning`, `error` */ diff --git a/components/alert/ErrorBoundary.tsx b/components/alert/ErrorBoundary.tsx index 8c8b6b2bd9..c9f29da938 100644 --- a/components/alert/ErrorBoundary.tsx +++ b/components/alert/ErrorBoundary.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Alert from './Alert'; interface ErrorBoundaryProps { diff --git a/components/alert/__tests__/index.test.tsx b/components/alert/__tests__/index.test.tsx index 2c170b49b0..acec353903 100644 --- a/components/alert/__tests__/index.test.tsx +++ b/components/alert/__tests__/index.test.tsx @@ -1,6 +1,7 @@ +import React from 'react'; import userEvent from '@testing-library/user-event'; import { resetWarned } from 'rc-util/lib/warning'; -import React from 'react'; + import Alert from '..'; import accessibilityTest from '../../../tests/shared/accessibilityTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/alert/demo/closable.tsx b/components/alert/demo/closable.tsx index d88ac700ce..4369716d8d 100644 --- a/components/alert/demo/closable.tsx +++ b/components/alert/demo/closable.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Alert, Space } from 'antd'; import { CloseSquareFilled } from '@ant-design/icons'; +import { Alert, Space } from 'antd'; const onClose = (e: React.MouseEvent) => { console.log(e, 'I was closed.'); diff --git a/components/alert/demo/component-token.tsx b/components/alert/demo/component-token.tsx index 4e9af03e52..00f1d7f1c3 100644 --- a/components/alert/demo/component-token.tsx +++ b/components/alert/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { SmileOutlined } from '@ant-design/icons'; import React from 'react'; +import { SmileOutlined } from '@ant-design/icons'; import { Alert, ConfigProvider } from 'antd'; const icon = ; diff --git a/components/alert/demo/loop-banner.tsx b/components/alert/demo/loop-banner.tsx index 7324268df8..1f9a460d31 100644 --- a/components/alert/demo/loop-banner.tsx +++ b/components/alert/demo/loop-banner.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import Marquee from 'react-fast-marquee'; import { Alert } from 'antd'; +import Marquee from 'react-fast-marquee'; const App: React.FC = () => ( { const [visible, setVisible] = useState(true); diff --git a/components/alert/index.ts b/components/alert/index.ts index 6b3a78f121..66e8ed2adf 100644 --- a/components/alert/index.ts +++ b/components/alert/index.ts @@ -1,4 +1,5 @@ import type React from 'react'; + import type { AlertProps } from './Alert'; import InternalAlert from './Alert'; import ErrorBoundary from './ErrorBoundary'; diff --git a/components/anchor/__tests__/Anchor.test.tsx b/components/anchor/__tests__/Anchor.test.tsx index 7c21c8ec19..760bf21b67 100644 --- a/components/anchor/__tests__/Anchor.test.tsx +++ b/components/anchor/__tests__/Anchor.test.tsx @@ -1,5 +1,5 @@ -import { resetWarned } from 'rc-util/lib/warning'; import React, { useState } from 'react'; +import { resetWarned } from 'rc-util/lib/warning'; import scrollIntoView from 'scroll-into-view-if-needed'; import Anchor from '..'; diff --git a/components/anchor/__tests__/cached-context.test.tsx b/components/anchor/__tests__/cached-context.test.tsx index 8db4f3e27c..de16715b52 100644 --- a/components/anchor/__tests__/cached-context.test.tsx +++ b/components/anchor/__tests__/cached-context.test.tsx @@ -1,4 +1,5 @@ import React, { memo, useContext } from 'react'; + import { fireEvent, pureRender } from '../../../tests/utils'; import Anchor from '../Anchor'; import AnchorContext from '../context'; diff --git a/components/anchor/__tests__/demo.test.tsx b/components/anchor/__tests__/demo.test.tsx index 3d68d0fd2c..e1bfd40963 100644 --- a/components/anchor/__tests__/demo.test.tsx +++ b/components/anchor/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('anchor', { diff --git a/components/anchor/context.ts b/components/anchor/context.ts index ab5c0474e2..7413ce37b3 100644 --- a/components/anchor/context.ts +++ b/components/anchor/context.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { AntAnchor } from './Anchor'; const AnchorContext = React.createContext(undefined); diff --git a/components/anchor/demo/basic.tsx b/components/anchor/demo/basic.tsx index 325709cb54..812f475a0b 100644 --- a/components/anchor/demo/basic.tsx +++ b/components/anchor/demo/basic.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Anchor, Row, Col } from 'antd'; +import { Anchor, Col, Row } from 'antd'; const App: React.FC = () => ( diff --git a/components/anchor/demo/targetOffset.tsx b/components/anchor/demo/targetOffset.tsx index 79428a8e59..27927783a2 100644 --- a/components/anchor/demo/targetOffset.tsx +++ b/components/anchor/demo/targetOffset.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { Anchor, Row, Col } from 'antd'; +import { Anchor, Col, Row } from 'antd'; const App: React.FC = () => { const topRef = React.useRef(null); diff --git a/components/auto-complete/__tests__/demo.test.tsx b/components/auto-complete/__tests__/demo.test.tsx index 002b3e7646..cfdfc6d313 100644 --- a/components/auto-complete/__tests__/demo.test.tsx +++ b/components/auto-complete/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('auto-complete', { diff --git a/components/auto-complete/__tests__/focus.test.tsx b/components/auto-complete/__tests__/focus.test.tsx index 167d579848..419c97dbc6 100644 --- a/components/auto-complete/__tests__/focus.test.tsx +++ b/components/auto-complete/__tests__/focus.test.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; + import AutoComplete from '..'; import { render } from '../../../tests/utils'; diff --git a/components/auto-complete/__tests__/index.test.tsx b/components/auto-complete/__tests__/index.test.tsx index 6dbb9c11b7..687ac09efb 100644 --- a/components/auto-complete/__tests__/index.test.tsx +++ b/components/auto-complete/__tests__/index.test.tsx @@ -1,10 +1,11 @@ -import userEvent from '@testing-library/user-event'; import React from 'react'; +import userEvent from '@testing-library/user-event'; + import AutoComplete from '..'; +import { resetWarned } from '../../_util/warning'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render, screen } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; import Input from '../../input'; describe('AutoComplete', () => { diff --git a/components/auto-complete/demo/render-panel.tsx b/components/auto-complete/demo/render-panel.tsx index 7eb320ce35..fb1947d4d0 100644 --- a/components/auto-complete/demo/render-panel.tsx +++ b/components/auto-complete/demo/render-panel.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { AutoComplete, Switch, Space } from 'antd'; +import { AutoComplete, Space, Switch } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: InternalAutoComplete } = AutoComplete; diff --git a/components/avatar/AvatarContext.ts b/components/avatar/AvatarContext.ts index b56bfeab71..64f0641939 100644 --- a/components/avatar/AvatarContext.ts +++ b/components/avatar/AvatarContext.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { ScreenSizeMap } from '../_util/responsiveObserver'; export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap; diff --git a/components/avatar/__tests__/Avatar.test.tsx b/components/avatar/__tests__/Avatar.test.tsx index 2cf2899a46..26f2cb1c7e 100644 --- a/components/avatar/__tests__/Avatar.test.tsx +++ b/components/avatar/__tests__/Avatar.test.tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react'; + import Avatar from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; -import useBreakpoint from '../../grid/hooks/useBreakpoint'; import ConfigProvider from '../../config-provider'; +import useBreakpoint from '../../grid/hooks/useBreakpoint'; jest.mock('../../grid/hooks/useBreakpoint'); diff --git a/components/avatar/__tests__/demo.test.tsx b/components/avatar/__tests__/demo.test.tsx index 71d78cbd05..469cd66226 100644 --- a/components/avatar/__tests__/demo.test.tsx +++ b/components/avatar/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('avatar'); diff --git a/components/avatar/demo/badge.tsx b/components/avatar/demo/badge.tsx index d920d1f633..fe59e4b6c8 100644 --- a/components/avatar/demo/badge.tsx +++ b/components/avatar/demo/badge.tsx @@ -1,5 +1,5 @@ -import { UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { UserOutlined } from '@ant-design/icons'; import { Avatar, Badge, Space } from 'antd'; const App: React.FC = () => ( diff --git a/components/avatar/demo/basic.tsx b/components/avatar/demo/basic.tsx index 9fc6b6bcba..9b7aad98d7 100644 --- a/components/avatar/demo/basic.tsx +++ b/components/avatar/demo/basic.tsx @@ -1,5 +1,5 @@ -import { UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { UserOutlined } from '@ant-design/icons'; import { Avatar, Space } from 'antd'; const App: React.FC = () => ( diff --git a/components/avatar/demo/component-token.tsx b/components/avatar/demo/component-token.tsx index 11d686bec1..8216387378 100644 --- a/components/avatar/demo/component-token.tsx +++ b/components/avatar/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { AntDesignOutlined, UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { AntDesignOutlined, UserOutlined } from '@ant-design/icons'; import { Avatar, Badge, ConfigProvider, Space, Tooltip } from 'antd'; const App: React.FC = () => ( diff --git a/components/avatar/demo/group.tsx b/components/avatar/demo/group.tsx index 6519f12eed..9f56c44cc7 100644 --- a/components/avatar/demo/group.tsx +++ b/components/avatar/demo/group.tsx @@ -1,5 +1,5 @@ -import { AntDesignOutlined, UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { AntDesignOutlined, UserOutlined } from '@ant-design/icons'; import { Avatar, Divider, Tooltip } from 'antd'; const App: React.FC = () => ( diff --git a/components/avatar/demo/type.tsx b/components/avatar/demo/type.tsx index 79288b85a5..65ffe670c1 100644 --- a/components/avatar/demo/type.tsx +++ b/components/avatar/demo/type.tsx @@ -1,5 +1,5 @@ -import { UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { UserOutlined } from '@ant-design/icons'; import { Avatar, Space } from 'antd'; const url = 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg'; diff --git a/components/avatar/group.tsx b/components/avatar/group.tsx index 9844087197..936164a404 100644 --- a/components/avatar/group.tsx +++ b/components/avatar/group.tsx @@ -1,14 +1,15 @@ +import * as React from 'react'; import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import * as React from 'react'; -import { ConfigContext } from '../config-provider'; -import Popover from '../popover'; + import { cloneElement } from '../_util/reactNode'; +import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; +import Popover from '../popover'; import Avatar from './avatar'; import AvatarContext from './AvatarContext'; import type { AvatarContextType, AvatarSize } from './AvatarContext'; import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; interface ContextProps { children?: React.ReactNode; diff --git a/components/avatar/index.ts b/components/avatar/index.ts index ea2fa43580..c23a17db6e 100644 --- a/components/avatar/index.ts +++ b/components/avatar/index.ts @@ -1,4 +1,5 @@ import type { ForwardRefExoticComponent, RefAttributes } from 'react'; + import type { AvatarProps } from './avatar'; import InternalAvatar from './avatar'; import Group from './group'; diff --git a/components/avatar/style/index.ts b/components/avatar/style/index.ts index 8412d89fed..97be5147f5 100644 --- a/components/avatar/style/index.ts +++ b/components/avatar/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/back-top/__tests__/index.test.tsx b/components/back-top/__tests__/index.test.tsx index 1f658f00fe..7a959b4573 100644 --- a/components/back-top/__tests__/index.test.tsx +++ b/components/back-top/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import BackTop from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/back-top/style/index.ts b/components/back-top/style/index.ts index 29e7ea5775..92204a24e9 100644 --- a/components/back-top/style/index.ts +++ b/components/back-top/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index 79414bcde6..1fcf8a82fb 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { cloneElement } from '../_util/reactNode'; import { ConfigContext } from '../config-provider'; import SingleNumber from './SingleNumber'; diff --git a/components/badge/SingleNumber.tsx b/components/badge/SingleNumber.tsx index 3973a1e825..0e986025c7 100644 --- a/components/badge/SingleNumber.tsx +++ b/components/badge/SingleNumber.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; export interface UnitNumberProps { prefixCls: string; diff --git a/components/badge/__tests__/demo.test.tsx b/components/badge/__tests__/demo.test.tsx index 18e41f6256..7177e192bd 100644 --- a/components/badge/__tests__/demo.test.tsx +++ b/components/badge/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('badge'); diff --git a/components/badge/__tests__/index.test.tsx b/components/badge/__tests__/index.test.tsx index 9a23c6b351..3207f7e6a5 100644 --- a/components/badge/__tests__/index.test.tsx +++ b/components/badge/__tests__/index.test.tsx @@ -1,6 +1,7 @@ -import { fireEvent, render } from '@testing-library/react'; import React from 'react'; +import { fireEvent, render } from '@testing-library/react'; import { act } from 'react-dom/test-utils'; + import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import Tooltip from '../../tooltip'; diff --git a/components/badge/__tests__/ribbon.test.tsx b/components/badge/__tests__/ribbon.test.tsx index 9206bf43b8..042b3b438a 100644 --- a/components/badge/__tests__/ribbon.test.tsx +++ b/components/badge/__tests__/ribbon.test.tsx @@ -1,5 +1,6 @@ -import { render } from '@testing-library/react'; import React from 'react'; +import { render } from '@testing-library/react'; + import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import Badge from '../index'; diff --git a/components/badge/demo/change.tsx b/components/badge/demo/change.tsx index aec8bbbf61..2e1a9d2c08 100644 --- a/components/badge/demo/change.tsx +++ b/components/badge/demo/change.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { MinusOutlined, PlusOutlined, QuestionOutlined } from '@ant-design/icons'; -import { Avatar, Badge, Button, Switch, Space } from 'antd'; +import { Avatar, Badge, Button, Space, Switch } from 'antd'; const ButtonGroup = Button.Group; diff --git a/components/badge/demo/component-token.tsx b/components/badge/demo/component-token.tsx index f9f32ad037..dda8817d17 100644 --- a/components/badge/demo/component-token.tsx +++ b/components/badge/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { NotificationOutlined } from '@ant-design/icons'; import React from 'react'; +import { NotificationOutlined } from '@ant-design/icons'; import { Avatar, Badge, ConfigProvider, Space } from 'antd'; /** Test usage. Do not use in your production. */ diff --git a/components/badge/demo/no-wrapper.tsx b/components/badge/demo/no-wrapper.tsx index 259596a61c..56c14dc7c0 100644 --- a/components/badge/demo/no-wrapper.tsx +++ b/components/badge/demo/no-wrapper.tsx @@ -8,7 +8,7 @@ const App: React.FC = () => { return ( setShow(!show)} /> - + : 0} /> & { diff --git a/components/breadcrumb/__tests__/Breadcrumb.test.tsx b/components/breadcrumb/__tests__/Breadcrumb.test.tsx index ccebb91521..22f8bd1259 100644 --- a/components/breadcrumb/__tests__/Breadcrumb.test.tsx +++ b/components/breadcrumb/__tests__/Breadcrumb.test.tsx @@ -1,9 +1,10 @@ import React from 'react'; + +import { resetWarned } from '../../_util/warning'; import accessibilityTest from '../../../tests/shared/accessibilityTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; import type { ItemType } from '../Breadcrumb'; import Breadcrumb from '../index'; diff --git a/components/breadcrumb/__tests__/itemRender.test.tsx b/components/breadcrumb/__tests__/itemRender.test.tsx index d476dede19..d9cc89120c 100644 --- a/components/breadcrumb/__tests__/itemRender.test.tsx +++ b/components/breadcrumb/__tests__/itemRender.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { render } from '../../../tests/utils'; import Breadcrumb from '../index'; diff --git a/components/breadcrumb/__tests__/router.test.tsx b/components/breadcrumb/__tests__/router.test.tsx index 87d22b994e..caa48d9b61 100644 --- a/components/breadcrumb/__tests__/router.test.tsx +++ b/components/breadcrumb/__tests__/router.test.tsx @@ -1,6 +1,7 @@ import React, { useMemo } from 'react'; import type { RouterProps } from 'react-router-dom'; import { Link, MemoryRouter, Route, Routes, useLocation, useNavigate } from 'react-router-dom'; + import { fireEvent, render } from '../../../tests/utils'; import Breadcrumb from '../index'; @@ -51,11 +52,11 @@ describe('react router', () => { , ].concat(extraBreadcrumbItems); const componentProps = useMemo( - () => ({ component: Apps } as unknown as RouterProps), + () => ({ component: Apps }) as unknown as RouterProps, [], ); const renderProps = useMemo( - () => ({ render: () => Home Page } as unknown as RouterProps), + () => ({ render: () => Home Page }) as unknown as RouterProps, [], ); return ( diff --git a/components/breadcrumb/demo/component-token.tsx b/components/breadcrumb/demo/component-token.tsx index b3d2f28e10..ac9e1f9994 100644 --- a/components/breadcrumb/demo/component-token.tsx +++ b/components/breadcrumb/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { HomeOutlined, UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { HomeOutlined, UserOutlined } from '@ant-design/icons'; import { Breadcrumb, ConfigProvider } from 'antd'; const menuItems = [ diff --git a/components/breadcrumb/demo/withIcon.tsx b/components/breadcrumb/demo/withIcon.tsx index bde49477fe..9e1ff86ddc 100644 --- a/components/breadcrumb/demo/withIcon.tsx +++ b/components/breadcrumb/demo/withIcon.tsx @@ -1,5 +1,5 @@ -import { HomeOutlined, UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { HomeOutlined, UserOutlined } from '@ant-design/icons'; import { Breadcrumb } from 'antd'; const App: React.FC = () => ( diff --git a/components/breadcrumb/style/index.ts b/components/breadcrumb/style/index.ts index 8c2e7f178c..2a229ed787 100644 --- a/components/breadcrumb/style/index.ts +++ b/components/breadcrumb/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { genFocusStyle, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/breadcrumb/useItemRender.tsx b/components/breadcrumb/useItemRender.tsx index 0a43958c9b..e3b0a9f810 100644 --- a/components/breadcrumb/useItemRender.tsx +++ b/components/breadcrumb/useItemRender.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import classNames from 'classnames'; import pickAttrs from 'rc-util/lib/pickAttrs'; -import * as React from 'react'; + import type { BreadcrumbProps, InternalRouteType, ItemType } from './Breadcrumb'; type AddParameters any, TParameters extends [...args: any]> = ( diff --git a/components/breadcrumb/useItems.ts b/components/breadcrumb/useItems.ts index ac0e74abfe..e7e71ccbc6 100644 --- a/components/breadcrumb/useItems.ts +++ b/components/breadcrumb/useItems.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import type { BreadcrumbItemType, BreadcrumbSeparatorType, ItemType } from './Breadcrumb'; type MergedType = BreadcrumbItemType & { diff --git a/components/button/LoadingIcon.tsx b/components/button/LoadingIcon.tsx index 74918bb19c..951b72a075 100644 --- a/components/button/LoadingIcon.tsx +++ b/components/button/LoadingIcon.tsx @@ -1,7 +1,8 @@ +import React, { forwardRef } from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import CSSMotion from 'rc-motion'; -import React, { forwardRef } from 'react'; + import IconWrapper from './IconWrapper'; type InnerLoadingIconProps = { diff --git a/components/button/__tests__/delay-timer.test.tsx b/components/button/__tests__/delay-timer.test.tsx index 42bdca9207..ee4c2ffc3d 100644 --- a/components/button/__tests__/delay-timer.test.tsx +++ b/components/button/__tests__/delay-timer.test.tsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; import { act } from 'react-dom/test-utils'; + import { fireEvent, render } from '../../../tests/utils'; import Button from '../button'; diff --git a/components/button/__tests__/wave.test.tsx b/components/button/__tests__/wave.test.tsx index 80da394ba8..9347c65f97 100644 --- a/components/button/__tests__/wave.test.tsx +++ b/components/button/__tests__/wave.test.tsx @@ -1,5 +1,6 @@ -import userEvent from '@testing-library/user-event'; import React from 'react'; +import userEvent from '@testing-library/user-event'; + import Button from '..'; import { act, fireEvent, render } from '../../../tests/utils'; diff --git a/components/button/buttonHelpers.tsx b/components/button/buttonHelpers.tsx index a429debdf8..3c40eb5084 100644 --- a/components/button/buttonHelpers.tsx +++ b/components/button/buttonHelpers.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { cloneElement, isFragment } from '../_util/reactNode'; import type { BaseButtonProps, LegacyButtonType } from './button'; @@ -75,10 +76,10 @@ export function spaceChildren(children: React.ReactNode, needInserted: boolean) } const ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'] as const; -export type ButtonType = typeof ButtonTypes[number]; +export type ButtonType = (typeof ButtonTypes)[number]; const ButtonShapes = ['default', 'circle', 'round'] as const; -export type ButtonShape = typeof ButtonShapes[number]; +export type ButtonShape = (typeof ButtonShapes)[number]; const ButtonHTMLTypes = ['submit', 'button', 'reset'] as const; -export type ButtonHTMLType = typeof ButtonHTMLTypes[number]; +export type ButtonHTMLType = (typeof ButtonHTMLTypes)[number]; diff --git a/components/button/demo/debug-block.tsx b/components/button/demo/debug-block.tsx index 10641e5940..fea84bd1f8 100644 --- a/components/button/demo/debug-block.tsx +++ b/components/button/demo/debug-block.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { DownloadOutlined } from '@ant-design/icons'; -import { Form, Button } from 'antd'; +import { Button, Form } from 'antd'; const App: React.FC = () => (
diff --git a/components/button/demo/debug-icon.tsx b/components/button/demo/debug-icon.tsx index 7dca5e6669..d25a57f032 100644 --- a/components/button/demo/debug-icon.tsx +++ b/components/button/demo/debug-icon.tsx @@ -1,14 +1,7 @@ import React from 'react'; import { SearchOutlined } from '@ant-design/icons'; -import { - Button, - ConfigProvider, - Divider, - Flex, - Radio, - Tooltip, - type ConfigProviderProps, -} from 'antd'; +import { Button, ConfigProvider, Divider, Flex, Radio, Tooltip } from 'antd'; +import type { ConfigProviderProps } from 'antd'; type SizeType = ConfigProviderProps['componentSize']; diff --git a/components/button/demo/linear-gradient.tsx b/components/button/demo/linear-gradient.tsx index ee82083762..66a8a34f87 100644 --- a/components/button/demo/linear-gradient.tsx +++ b/components/button/demo/linear-gradient.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Button, ConfigProvider, Space } from 'antd'; import { TinyColor } from '@ctrl/tinycolor'; +import { Button, ConfigProvider, Space } from 'antd'; const colors1 = ['#6253E1', '#04BEFE']; const colors2 = ['#fc6076', '#ff9a44', '#ef9d43', '#e75516']; diff --git a/components/button/style/compactCmp.ts b/components/button/style/compactCmp.ts index c0922a0851..a480dc4a94 100644 --- a/components/button/style/compactCmp.ts +++ b/components/button/style/compactCmp.ts @@ -1,11 +1,12 @@ // Style as inline component -import type { ButtonToken } from './token'; -import { prepareComponentToken, prepareToken } from './token'; +import { unit } from '@ant-design/cssinjs'; + import { genCompactItemStyle } from '../../style/compact-item'; import { genCompactItemVerticalStyle } from '../../style/compact-item-vertical'; import type { GenerateStyle } from '../../theme/internal'; import { genSubStyleComponent } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; +import type { ButtonToken } from './token'; +import { prepareComponentToken, prepareToken } from './token'; const genButtonCompactStyle: GenerateStyle = (token) => { const { componentCls, calc } = token; diff --git a/components/button/style/group.ts b/components/button/style/group.ts index c13e199e61..75de12cc5a 100644 --- a/components/button/style/group.ts +++ b/components/button/style/group.ts @@ -1,5 +1,5 @@ -import type { ButtonToken } from './token'; import type { GenerateStyle } from '../../theme/internal'; +import type { ButtonToken } from './token'; const genButtonBorderStyle = (buttonTypeCls: string, borderColor: string) => ({ // Border diff --git a/components/button/style/token.ts b/components/button/style/token.ts index e7178fe123..9f70f2e667 100644 --- a/components/button/style/token.ts +++ b/components/button/style/token.ts @@ -1,4 +1,5 @@ import type { CSSProperties } from 'react'; + import type { FullToken, GetDefaultToken } from '../../theme/internal'; import { getLineHeight, mergeToken } from '../../theme/internal'; import type { GenStyleFn } from '../../theme/util/genComponentStyleHook'; diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index eeef2e8d5a..ddac2d1f9e 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -1,7 +1,8 @@ -import type { GenerateConfig } from 'rc-picker/lib/generate'; -import type { Locale } from 'rc-picker/lib/interface'; import * as React from 'react'; import { useContext, useMemo } from 'react'; +import type { GenerateConfig } from 'rc-picker/lib/generate'; +import type { Locale } from 'rc-picker/lib/interface'; + import { FormItemInputContext } from '../form/context'; import { Button, Group } from '../radio'; import Select from '../select'; diff --git a/components/calendar/__tests__/demo.test.ts b/components/calendar/__tests__/demo.test.ts index a29e22786f..f3b88d0f44 100644 --- a/components/calendar/__tests__/demo.test.ts +++ b/components/calendar/__tests__/demo.test.ts @@ -1,4 +1,5 @@ import dayjs from 'dayjs'; + import demoTest from '../../../tests/shared/demoTest'; demoTest('calendar', { diff --git a/components/calendar/__tests__/index.test.tsx b/components/calendar/__tests__/index.test.tsx index 9768c9684f..48fb1026a8 100644 --- a/components/calendar/__tests__/index.test.tsx +++ b/components/calendar/__tests__/index.test.tsx @@ -4,7 +4,7 @@ import 'dayjs/locale/zh-cn'; import React from 'react'; import MockDate from 'mockdate'; -import { type PickerPanelProps } from 'rc-picker'; +import type { PickerPanelProps } from 'rc-picker'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; import type { Locale } from 'rc-picker/lib/interface'; import { resetWarned } from 'rc-util/lib/warning'; @@ -16,7 +16,8 @@ import { fireEvent, render } from '../../../tests/utils'; import Group from '../../radio/group'; import Button from '../../radio/radioButton'; import Select from '../../select'; -import Header, { type CalendarHeaderProps } from '../Header'; +import Header from '../Header'; +import type { CalendarHeaderProps } from '../Header'; const ref: { calendarProps?: PickerPanelProps; diff --git a/components/calendar/demo/basic.tsx b/components/calendar/demo/basic.tsx index 0255c4bece..d79ed14736 100644 --- a/components/calendar/demo/basic.tsx +++ b/components/calendar/demo/basic.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import type { Dayjs } from 'dayjs'; import { Calendar } from 'antd'; import type { CalendarProps } from 'antd'; +import type { Dayjs } from 'dayjs'; const App: React.FC = () => { const onPanelChange = (value: Dayjs, mode: CalendarProps['mode']) => { diff --git a/components/calendar/demo/card.tsx b/components/calendar/demo/card.tsx index aa08fc1690..b346625b3e 100644 --- a/components/calendar/demo/card.tsx +++ b/components/calendar/demo/card.tsx @@ -1,7 +1,7 @@ -import type { Dayjs } from 'dayjs'; import React from 'react'; import { Calendar, theme } from 'antd'; import type { CalendarProps } from 'antd'; +import type { Dayjs } from 'dayjs'; const onPanelChange = (value: Dayjs, mode: CalendarProps['mode']) => { console.log(value.format('YYYY-MM-DD'), mode); diff --git a/components/calendar/demo/component-token.tsx b/components/calendar/demo/component-token.tsx index 90c3223d2f..5a27f76a98 100644 --- a/components/calendar/demo/component-token.tsx +++ b/components/calendar/demo/component-token.tsx @@ -1,7 +1,7 @@ -import type { Dayjs } from 'dayjs'; import React from 'react'; import { Calendar, ConfigProvider } from 'antd'; import type { CalendarProps } from 'antd'; +import type { Dayjs } from 'dayjs'; /** Test usage. Do not use in your production. */ export default () => { diff --git a/components/calendar/demo/customize-header.tsx b/components/calendar/demo/customize-header.tsx index 4b969e0f33..9f002c1111 100644 --- a/components/calendar/demo/customize-header.tsx +++ b/components/calendar/demo/customize-header.tsx @@ -1,10 +1,12 @@ import React from 'react'; import dayjs from 'dayjs'; + import 'dayjs/locale/zh-cn'; + +import { Calendar, Col, Radio, Row, Select, theme, Typography } from 'antd'; +import type { CalendarProps } from 'antd'; import type { Dayjs } from 'dayjs'; import dayLocaleData from 'dayjs/plugin/localeData'; -import { Calendar, Col, Radio, Row, Select, Typography, theme } from 'antd'; -import type { CalendarProps } from 'antd'; dayjs.extend(dayLocaleData); diff --git a/components/calendar/demo/lunar.tsx b/components/calendar/demo/lunar.tsx index 95035843a2..6a4c357197 100644 --- a/components/calendar/demo/lunar.tsx +++ b/components/calendar/demo/lunar.tsx @@ -1,11 +1,11 @@ -import dayjs from 'dayjs'; -import type { Dayjs } from 'dayjs'; import React from 'react'; -import { Lunar, HolidayUtil } from 'lunar-typescript'; -import { createStyles } from 'antd-style'; -import classNames from 'classnames'; import { Calendar, Col, Radio, Row, Select } from 'antd'; import type { CalendarProps } from 'antd'; +import { createStyles } from 'antd-style'; +import classNames from 'classnames'; +import dayjs from 'dayjs'; +import type { Dayjs } from 'dayjs'; +import { HolidayUtil, Lunar } from 'lunar-typescript'; const useStyle = createStyles(({ token, css, cx }) => { const lunar = css` diff --git a/components/calendar/demo/notice-calendar.tsx b/components/calendar/demo/notice-calendar.tsx index fbf6aa24bd..8243a390df 100644 --- a/components/calendar/demo/notice-calendar.tsx +++ b/components/calendar/demo/notice-calendar.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import type { Dayjs } from 'dayjs'; import type { BadgeProps, CalendarProps } from 'antd'; import { Badge, Calendar } from 'antd'; +import type { Dayjs } from 'dayjs'; const getListData = (value: Dayjs) => { let listData; diff --git a/components/calendar/demo/select.tsx b/components/calendar/demo/select.tsx index 117632be25..25d90bd5d6 100644 --- a/components/calendar/demo/select.tsx +++ b/components/calendar/demo/select.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; +import { Alert, Calendar } from 'antd'; import type { Dayjs } from 'dayjs'; import dayjs from 'dayjs'; -import { Alert, Calendar } from 'antd'; const App: React.FC = () => { const [value, setValue] = useState(() => dayjs('2017-01-25')); diff --git a/components/calendar/index.ts b/components/calendar/index.ts index 9933d970d3..d89d8cec86 100644 --- a/components/calendar/index.ts +++ b/components/calendar/index.ts @@ -1,5 +1,6 @@ import type { Dayjs } from 'dayjs'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; + import type { CalendarProps } from './generateCalendar'; import generateCalendar from './generateCalendar'; diff --git a/components/card/Grid.tsx b/components/card/Grid.tsx index 5b4f87ee8e..b4e0b32632 100644 --- a/components/card/Grid.tsx +++ b/components/card/Grid.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { ConfigContext } from '../config-provider'; import type { ConfigConsumerProps } from '../config-provider'; diff --git a/components/card/Meta.tsx b/components/card/Meta.tsx index 55107619ca..adbf4a4763 100644 --- a/components/card/Meta.tsx +++ b/components/card/Meta.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; diff --git a/components/card/__tests__/index.test.tsx b/components/card/__tests__/index.test.tsx index 79a94fe5b3..71fdfdafde 100644 --- a/components/card/__tests__/index.test.tsx +++ b/components/card/__tests__/index.test.tsx @@ -1,6 +1,8 @@ import '@testing-library/jest-dom'; -import userEvent from '@testing-library/user-event'; + import React from 'react'; +import userEvent from '@testing-library/user-event'; + import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render, screen } from '../../../tests/utils'; diff --git a/components/card/__tests__/type.test.tsx b/components/card/__tests__/type.test.tsx index 19eae9739f..ac499feab9 100644 --- a/components/card/__tests__/type.test.tsx +++ b/components/card/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Card from '../index'; describe('Card.typescript', () => { diff --git a/components/card/demo/component-token.tsx b/components/card/demo/component-token.tsx index ad0f924144..1c15e239f0 100644 --- a/components/card/demo/component-token.tsx +++ b/components/card/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; import React from 'react'; +import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; import { Card, ConfigProvider } from 'antd'; export default () => ( diff --git a/components/card/demo/loading.tsx b/components/card/demo/loading.tsx index 731dd79364..dcea37cf50 100644 --- a/components/card/demo/loading.tsx +++ b/components/card/demo/loading.tsx @@ -1,5 +1,5 @@ -import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'; import { Avatar, Card, Skeleton, Switch } from 'antd'; const { Meta } = Card; diff --git a/components/card/style/index.ts b/components/card/style/index.ts index 1bf3ddad2b..bc96d2b592 100644 --- a/components/card/style/index.ts +++ b/components/card/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { clearFix, resetComponent, textEllipsis } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/carousel/__tests__/index.test.tsx b/components/carousel/__tests__/index.test.tsx index 9334ce7f33..7e91f2d787 100644 --- a/components/carousel/__tests__/index.test.tsx +++ b/components/carousel/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { CarouselRef } from '..'; import Carousel from '..'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/cascader/__tests__/demo.test.tsx b/components/cascader/__tests__/demo.test.tsx index 53c929e436..016950408d 100644 --- a/components/cascader/__tests__/demo.test.tsx +++ b/components/cascader/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('cascader', { diff --git a/components/cascader/__tests__/index.test.tsx b/components/cascader/__tests__/index.test.tsx index 7a8a849673..70001ac062 100644 --- a/components/cascader/__tests__/index.test.tsx +++ b/components/cascader/__tests__/index.test.tsx @@ -1,13 +1,14 @@ -import type { SingleValueType } from 'rc-cascader/lib/Cascader'; import React from 'react'; +import type { SingleValueType } from 'rc-cascader/lib/Cascader'; + import type { BaseOptionType, DefaultOptionType } from '..'; import Cascader from '..'; +import { resetWarned } from '../../_util/warning'; import excludeAllWarning from '../../../tests/shared/excludeWarning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; import ConfigProvider from '../../config-provider'; const { SHOW_CHILD, SHOW_PARENT } = Cascader; diff --git a/components/cascader/__tests__/type.test.tsx b/components/cascader/__tests__/type.test.tsx index e0c9010e65..4dcb9387a9 100644 --- a/components/cascader/__tests__/type.test.tsx +++ b/components/cascader/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { BaseOptionType } from '..'; import Cascader from '..'; import { render } from '../../../tests/utils'; diff --git a/components/cascader/hooks/useBase.ts b/components/cascader/hooks/useBase.ts index 96e1706626..72c8589fee 100644 --- a/components/cascader/hooks/useBase.ts +++ b/components/cascader/hooks/useBase.ts @@ -1,6 +1,7 @@ import * as React from 'react'; -import { ConfigContext, type RenderEmptyHandler } from '../../config-provider'; +import { ConfigContext } from '../../config-provider'; +import type { RenderEmptyHandler } from '../../config-provider'; export default function useBase( customizePrefixCls?: string, diff --git a/components/cascader/style/columns.ts b/components/cascader/style/columns.ts index 760b08fa5a..60fbd9382c 100644 --- a/components/cascader/style/columns.ts +++ b/components/cascader/style/columns.ts @@ -1,4 +1,5 @@ -import { unit, type CSSInterpolation } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSInterpolation } from '@ant-design/cssinjs'; import type { CascaderToken } from '.'; import { getStyle as getCheckboxStyle } from '../../checkbox/style'; diff --git a/components/cascader/style/panel.ts b/components/cascader/style/panel.ts index 61b3075228..9becab97aa 100644 --- a/components/cascader/style/panel.ts +++ b/components/cascader/style/panel.ts @@ -1,7 +1,10 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; -import { prepareComponentToken, type CascaderToken } from '.'; -import { genComponentStyleHook, type GenerateStyle } from '../../theme/internal'; +import { prepareComponentToken } from '.'; +import type { CascaderToken } from '.'; +import { genComponentStyleHook } from '../../theme/internal'; +import type { GenerateStyle } from '../../theme/internal'; import getColumnsStyle from './columns'; // ============================== Panel =============================== diff --git a/components/checkbox/__tests__/checkbox.test.tsx b/components/checkbox/__tests__/checkbox.test.tsx index 8cd3d6dcde..c4c2b8142b 100644 --- a/components/checkbox/__tests__/checkbox.test.tsx +++ b/components/checkbox/__tests__/checkbox.test.tsx @@ -1,10 +1,11 @@ import React from 'react'; + import Checkbox from '..'; +import { resetWarned } from '../../_util/warning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; describe('Checkbox', () => { focusTest(Checkbox, { refFocus: true }); diff --git a/components/checkbox/__tests__/demo.test.tsx b/components/checkbox/__tests__/demo.test.tsx index c506cb1542..b68fd9492c 100644 --- a/components/checkbox/__tests__/demo.test.tsx +++ b/components/checkbox/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('checkbox'); diff --git a/components/checkbox/__tests__/type.test.tsx b/components/checkbox/__tests__/type.test.tsx index b519588776..802852be82 100644 --- a/components/checkbox/__tests__/type.test.tsx +++ b/components/checkbox/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Checkbox from '..'; import type { CheckboxRef } from '..'; import Input from '../../input'; diff --git a/components/checkbox/index.ts b/components/checkbox/index.ts index 53b0c0493a..e08ab43101 100644 --- a/components/checkbox/index.ts +++ b/components/checkbox/index.ts @@ -1,5 +1,6 @@ import type * as React from 'react'; import type { CheckboxRef } from 'rc-checkbox'; + import type { CheckboxProps } from './Checkbox'; import InternalCheckbox from './Checkbox'; import Group from './Group'; diff --git a/components/col/index.ts b/components/col/index.ts index 413ae4d2be..92e1f5e8fd 100644 --- a/components/col/index.ts +++ b/components/col/index.ts @@ -1,4 +1,5 @@ -import { Col, type ColProps, type ColSize } from '../grid'; +import { Col } from '../grid'; +import type { ColProps, ColSize } from '../grid'; export type { ColProps, ColSize }; diff --git a/components/collapse/demo/component-token.tsx b/components/collapse/demo/component-token.tsx index 8243c56037..f16bbd037f 100644 --- a/components/collapse/demo/component-token.tsx +++ b/components/collapse/demo/component-token.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { Collapse, ConfigProvider } from 'antd'; - /** Test usage. Do not use in your production. */ import type { CollapseProps } from 'antd'; diff --git a/components/collapse/demo/custom.tsx b/components/collapse/demo/custom.tsx index d0fad5737e..f4c6b7d3a9 100644 --- a/components/collapse/demo/custom.tsx +++ b/components/collapse/demo/custom.tsx @@ -1,6 +1,6 @@ -import { CaretRightOutlined } from '@ant-design/icons'; import type { CSSProperties } from 'react'; import React from 'react'; +import { CaretRightOutlined } from '@ant-design/icons'; import type { CollapseProps } from 'antd'; import { Collapse, theme } from 'antd'; diff --git a/components/collapse/demo/extra.tsx b/components/collapse/demo/extra.tsx index dc2eaca17b..2e6df64c1d 100644 --- a/components/collapse/demo/extra.tsx +++ b/components/collapse/demo/extra.tsx @@ -1,5 +1,5 @@ -import { SettingOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { SettingOutlined } from '@ant-design/icons'; import type { CollapseProps } from 'antd'; import { Collapse, Select } from 'antd'; diff --git a/components/color-picker/__tests__/components.test.tsx b/components/color-picker/__tests__/components.test.tsx index b4f17cd8ed..ba8665007b 100644 --- a/components/color-picker/__tests__/components.test.tsx +++ b/components/color-picker/__tests__/components.test.tsx @@ -1,5 +1,6 @@ -import { fireEvent, render } from '@testing-library/react'; import React from 'react'; +import { fireEvent, render } from '@testing-library/react'; + import ColorAlphaInput from '../components/ColorAlphaInput'; import ColorHexInput from '../components/ColorHexInput'; import ColorHsbInput from '../components/ColorHsbInput'; diff --git a/components/color-picker/components/ColorClear.tsx b/components/color-picker/components/ColorClear.tsx index bda72c2412..f2be6e9d1c 100644 --- a/components/color-picker/components/ColorClear.tsx +++ b/components/color-picker/components/ColorClear.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react'; import React from 'react'; + import type { Color } from '../color'; import type { ColorPickerBaseProps } from '../interface'; import { generateColor } from '../util'; diff --git a/components/color-picker/components/ColorHexInput.tsx b/components/color-picker/components/ColorHexInput.tsx index 92130806c7..5a3174268f 100644 --- a/components/color-picker/components/ColorHexInput.tsx +++ b/components/color-picker/components/ColorHexInput.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; + import Input from '../../input'; import type { Color } from '../color'; import { toHexFormat } from '../color'; diff --git a/components/color-picker/components/ColorHsbInput.tsx b/components/color-picker/components/ColorHsbInput.tsx index 3e992ca0fe..575b7d3c57 100644 --- a/components/color-picker/components/ColorHsbInput.tsx +++ b/components/color-picker/components/ColorHsbInput.tsx @@ -1,6 +1,7 @@ -import type { HSB } from '@rc-component/color-picker'; import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; +import type { HSB } from '@rc-component/color-picker'; + import type { Color } from '../color'; import type { ColorPickerBaseProps } from '../interface'; import { generateColor, getRoundNumber } from '../util'; diff --git a/components/color-picker/components/ColorRgbInput.tsx b/components/color-picker/components/ColorRgbInput.tsx index 781043578b..e51092ad3f 100644 --- a/components/color-picker/components/ColorRgbInput.tsx +++ b/components/color-picker/components/ColorRgbInput.tsx @@ -1,6 +1,7 @@ -import type { RGB } from '@rc-component/color-picker'; import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; +import type { RGB } from '@rc-component/color-picker'; + import type { Color } from '../color'; import type { ColorPickerBaseProps } from '../interface'; import { generateColor } from '../util'; diff --git a/components/color-picker/components/ColorSteppers.tsx b/components/color-picker/components/ColorSteppers.tsx index ccbce13212..a0a085d34a 100644 --- a/components/color-picker/components/ColorSteppers.tsx +++ b/components/color-picker/components/ColorSteppers.tsx @@ -1,6 +1,7 @@ -import classNames from 'classnames'; import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; +import classNames from 'classnames'; + import type { InputNumberProps } from '../../input-number'; import InputNumber from '../../input-number'; import type { ColorPickerBaseProps } from '../interface'; diff --git a/components/color-picker/components/ColorTrigger.tsx b/components/color-picker/components/ColorTrigger.tsx index f84cdb62c9..f11da241d2 100644 --- a/components/color-picker/components/ColorTrigger.tsx +++ b/components/color-picker/components/ColorTrigger.tsx @@ -1,8 +1,9 @@ -import { ColorBlock } from '@rc-component/color-picker'; -import classNames from 'classnames'; import type { CSSProperties, MouseEventHandler } from 'react'; import React, { forwardRef, useMemo } from 'react'; -import type { ColorPickerProps, ColorPickerBaseProps } from '../interface'; +import { ColorBlock } from '@rc-component/color-picker'; +import classNames from 'classnames'; + +import type { ColorPickerBaseProps, ColorPickerProps } from '../interface'; import { getAlphaColor } from '../util'; import ColorClear from './ColorClear'; diff --git a/components/color-picker/components/PanelPicker.tsx b/components/color-picker/components/PanelPicker.tsx index d4192d2e56..18b3c228c1 100644 --- a/components/color-picker/components/PanelPicker.tsx +++ b/components/color-picker/components/PanelPicker.tsx @@ -1,13 +1,14 @@ -import type { HsbaColorType } from '@rc-component/color-picker'; -import RcColorPicker from '@rc-component/color-picker'; import type { FC } from 'react'; import React, { useContext } from 'react'; +import type { HsbaColorType } from '@rc-component/color-picker'; +import RcColorPicker from '@rc-component/color-picker'; + import type { Color } from '../color'; import { PanelPickerContext } from '../context'; import type { ColorPickerBaseProps } from '../interface'; +import { generateColor } from '../util'; import ColorClear from './ColorClear'; import ColorInput from './ColorInput'; -import { generateColor } from '../util'; export interface PanelPickerProps extends Pick< diff --git a/components/color-picker/components/PanelPresets.tsx b/components/color-picker/components/PanelPresets.tsx index b978df408a..adc96287cd 100644 --- a/components/color-picker/components/PanelPresets.tsx +++ b/components/color-picker/components/PanelPresets.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react'; import React, { useContext } from 'react'; + import type { Color } from '../color'; import { PanelPresetsContext } from '../context'; import type { ColorPickerBaseProps } from '../interface'; diff --git a/components/color-picker/context.ts b/components/color-picker/context.ts index 5d80e2f927..df6d1ba143 100644 --- a/components/color-picker/context.ts +++ b/components/color-picker/context.ts @@ -1,4 +1,5 @@ import React from 'react'; + import type { PanelPickerProps } from './components/PanelPicker'; import type { PanelPresetsProps } from './components/PanelPresets'; diff --git a/components/color-picker/demo/panel-render.tsx b/components/color-picker/demo/panel-render.tsx index d1715901db..db229ec9c6 100644 --- a/components/color-picker/demo/panel-render.tsx +++ b/components/color-picker/demo/panel-render.tsx @@ -1,7 +1,7 @@ import React from 'react'; +import { cyan, generate, green, presetPalettes, red } from '@ant-design/colors'; import { Col, ColorPicker, Divider, Row, Space, theme } from 'antd'; import type { ColorPickerProps } from 'antd'; -import { generate, green, presetPalettes, red, cyan } from '@ant-design/colors'; type Presets = Required['presets'][number]; diff --git a/components/color-picker/style/color-block.ts b/components/color-picker/style/color-block.ts index c99dbb1d35..268990a2f9 100644 --- a/components/color-picker/style/color-block.ts +++ b/components/color-picker/style/color-block.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { ColorPickerToken } from './index'; diff --git a/components/color-picker/style/index.ts b/components/color-picker/style/index.ts index d96323f3bf..8196c71ae5 100644 --- a/components/color-picker/style/index.ts +++ b/components/color-picker/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { FullToken, GenerateStyle } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/color-picker/style/input.ts b/components/color-picker/style/input.ts index e8b475ff83..09cde3f600 100644 --- a/components/color-picker/style/input.ts +++ b/components/color-picker/style/input.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { ColorPickerToken } from './index'; diff --git a/components/color-picker/style/picker.ts b/components/color-picker/style/picker.ts index 9287416e87..fd04b9d087 100644 --- a/components/color-picker/style/picker.ts +++ b/components/color-picker/style/picker.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import { getTransBg } from './color-block'; diff --git a/components/color-picker/style/presets.ts b/components/color-picker/style/presets.ts index 9156db3167..3f7c39d2e6 100644 --- a/components/color-picker/style/presets.ts +++ b/components/color-picker/style/presets.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { ColorPickerToken } from './index'; diff --git a/components/color-picker/util.ts b/components/color-picker/util.ts index 388658e572..116c4f31be 100644 --- a/components/color-picker/util.ts +++ b/components/color-picker/util.ts @@ -1,4 +1,5 @@ import type { ColorGenInput } from '@rc-component/color-picker'; + import type { Color } from './color'; import { ColorFactory } from './color'; diff --git a/components/config-provider/MotionWrapper.tsx b/components/config-provider/MotionWrapper.tsx index d248b38336..5f8e8b3645 100644 --- a/components/config-provider/MotionWrapper.tsx +++ b/components/config-provider/MotionWrapper.tsx @@ -1,5 +1,6 @@ -import { Provider as MotionProvider } from 'rc-motion'; import * as React from 'react'; +import { Provider as MotionProvider } from 'rc-motion'; + import { useToken } from '../theme/internal'; export interface MotionWrapperProps { diff --git a/components/config-provider/__tests__/button.test.tsx b/components/config-provider/__tests__/button.test.tsx index 0ffcf0505f..3167474389 100644 --- a/components/config-provider/__tests__/button.test.tsx +++ b/components/config-provider/__tests__/button.test.tsx @@ -1,6 +1,7 @@ -import { SearchOutlined } from '@ant-design/icons'; import React from 'react'; +import { SearchOutlined } from '@ant-design/icons'; import Button from 'antd/es/button'; + import ConfigProvider from '..'; import { render } from '../../../tests/utils'; diff --git a/components/config-provider/__tests__/container.test.tsx b/components/config-provider/__tests__/container.test.tsx index 7168298faa..f5ea3187db 100644 --- a/components/config-provider/__tests__/container.test.tsx +++ b/components/config-provider/__tests__/container.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import ConfigProvider from '..'; import { fireEvent, render } from '../../../tests/utils'; import Cascader from '../../cascader'; diff --git a/components/config-provider/__tests__/cssinjs.test.tsx b/components/config-provider/__tests__/cssinjs.test.tsx index 8de4f474e0..2e476323e5 100644 --- a/components/config-provider/__tests__/cssinjs.test.tsx +++ b/components/config-provider/__tests__/cssinjs.test.tsx @@ -1,9 +1,10 @@ import * as React from 'react'; import { SmileOutlined } from '@ant-design/icons'; + import ConfigProvider from '..'; +import { render } from '../../../tests/utils'; import Button from '../../button'; import Divider from '../../divider'; -import { render } from '../../../tests/utils'; describe('ConfigProvider.DynamicTheme', () => { beforeEach(() => { diff --git a/components/config-provider/__tests__/form.test.tsx b/components/config-provider/__tests__/form.test.tsx index 919603988f..4a49cd9829 100644 --- a/components/config-provider/__tests__/form.test.tsx +++ b/components/config-provider/__tests__/form.test.tsx @@ -1,7 +1,8 @@ -import type { ValidateMessages } from 'rc-field-form/es/interface'; import React from 'react'; +import type { ValidateMessages } from 'rc-field-form/es/interface'; import { act } from 'react-dom/test-utils'; import scrollIntoView from 'scroll-into-view-if-needed'; + import ConfigProvider from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import Button from '../../button'; diff --git a/components/config-provider/__tests__/locale.test.tsx b/components/config-provider/__tests__/locale.test.tsx index bd2433c5a2..3e63c239ee 100644 --- a/components/config-provider/__tests__/locale.test.tsx +++ b/components/config-provider/__tests__/locale.test.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; + import ConfigProvider from '..'; import { act, fireEvent, render } from '../../../tests/utils'; import DatePicker from '../../date-picker'; diff --git a/components/config-provider/__tests__/nonce.test.tsx b/components/config-provider/__tests__/nonce.test.tsx index 29c2f5a4c7..b0ac962c02 100644 --- a/components/config-provider/__tests__/nonce.test.tsx +++ b/components/config-provider/__tests__/nonce.test.tsx @@ -1,7 +1,8 @@ +import React from 'react'; import { createCache, StyleProvider } from '@ant-design/cssinjs'; import { SmileOutlined } from '@ant-design/icons'; import IconContext from '@ant-design/icons/lib/components/Context'; -import React from 'react'; + import ConfigProvider from '..'; import { render } from '../../../tests/utils'; import Button from '../../button'; diff --git a/components/config-provider/__tests__/pagination.test.tsx b/components/config-provider/__tests__/pagination.test.tsx index 4ccfc03193..e027971f39 100644 --- a/components/config-provider/__tests__/pagination.test.tsx +++ b/components/config-provider/__tests__/pagination.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import ConfigProvider from '..'; import { render } from '../../../tests/utils'; import Pagination from '../../pagination'; diff --git a/components/config-provider/__tests__/popup.test.tsx b/components/config-provider/__tests__/popup.test.tsx index 4fcca48359..b6a78af067 100644 --- a/components/config-provider/__tests__/popup.test.tsx +++ b/components/config-provider/__tests__/popup.test.tsx @@ -1,7 +1,8 @@ +import React from 'react'; import type { TriggerProps, TriggerRef } from '@rc-component/trigger'; import dayjs from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; -import React from 'react'; + import ConfigProvider from '..'; import { render } from '../../../tests/utils'; import Cascader from '../../cascader'; diff --git a/components/config-provider/__tests__/target.test.tsx b/components/config-provider/__tests__/target.test.tsx index b4c7ad629a..09782f6d06 100644 --- a/components/config-provider/__tests__/target.test.tsx +++ b/components/config-provider/__tests__/target.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import ConfigProvider from '..'; import { act, render } from '../../../tests/utils'; import Affix from '../../affix'; diff --git a/components/config-provider/__tests__/theme.test.tsx b/components/config-provider/__tests__/theme.test.tsx index dc9a862974..1c7fa2150a 100644 --- a/components/config-provider/__tests__/theme.test.tsx +++ b/components/config-provider/__tests__/theme.test.tsx @@ -3,9 +3,9 @@ import kebabCase from 'lodash/kebabCase'; import canUseDom from 'rc-util/lib/Dom/canUseDom'; import ConfigProvider from '..'; -import { InputNumber, Button, Select } from '../..'; -import { render } from '../../../tests/utils'; +import { Button, InputNumber, Select } from '../..'; import { resetWarned } from '../../_util/warning'; +import { render } from '../../../tests/utils'; import theme from '../../theme'; import { useToken } from '../../theme/internal'; diff --git a/components/config-provider/__tests__/useConfig.test.tsx b/components/config-provider/__tests__/useConfig.test.tsx index a924fcecb7..33edb8ce1a 100644 --- a/components/config-provider/__tests__/useConfig.test.tsx +++ b/components/config-provider/__tests__/useConfig.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; + import ConfigProvider from '..'; -import { render } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; +import { render } from '../../../tests/utils'; import Form from '../../form'; describe('ConfigProvider.useConfig', () => { diff --git a/components/config-provider/__tests__/useSize.test.tsx b/components/config-provider/__tests__/useSize.test.tsx index 2e0c2b20b1..39ea0e5952 100644 --- a/components/config-provider/__tests__/useSize.test.tsx +++ b/components/config-provider/__tests__/useSize.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { render } from '../../../tests/utils'; import useSize from '../hooks/useSize'; diff --git a/components/config-provider/__tests__/wave.test.tsx b/components/config-provider/__tests__/wave.test.tsx index 8958e38c19..59cf899d10 100644 --- a/components/config-provider/__tests__/wave.test.tsx +++ b/components/config-provider/__tests__/wave.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import ConfigProvider from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import Button from '../../button'; diff --git a/components/config-provider/cssVariables.ts b/components/config-provider/cssVariables.ts index 84a0fda3c5..ba331bc48b 100644 --- a/components/config-provider/cssVariables.ts +++ b/components/config-provider/cssVariables.ts @@ -4,6 +4,7 @@ import { generate } from '@ant-design/colors'; import { TinyColor } from '@ctrl/tinycolor'; import canUseDom from 'rc-util/lib/Dom/canUseDom'; import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS'; + import warning from '../_util/warning'; import type { Theme } from './context'; diff --git a/components/config-provider/defaultRenderEmpty.tsx b/components/config-provider/defaultRenderEmpty.tsx index b50a863b68..af37f93a10 100644 --- a/components/config-provider/defaultRenderEmpty.tsx +++ b/components/config-provider/defaultRenderEmpty.tsx @@ -1,4 +1,5 @@ import React, { useContext } from 'react'; + import type { ConfigConsumerProps } from '.'; import { ConfigContext } from '.'; import Empty from '../empty'; diff --git a/components/config-provider/demo/prefixCls.tsx b/components/config-provider/demo/prefixCls.tsx index 62373371ec..99119776ad 100644 --- a/components/config-provider/demo/prefixCls.tsx +++ b/components/config-provider/demo/prefixCls.tsx @@ -1,5 +1,5 @@ -import { SmileOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { SmileOutlined } from '@ant-design/icons'; import { Button, ConfigProvider, Select } from 'antd'; // Ant Design site use `es` module for view diff --git a/components/config-provider/hooks/useConfig.ts b/components/config-provider/hooks/useConfig.ts index 10f8ed6398..1015713dee 100644 --- a/components/config-provider/hooks/useConfig.ts +++ b/components/config-provider/hooks/useConfig.ts @@ -1,4 +1,5 @@ import { useContext } from 'react'; + import DisabledContext from '../DisabledContext'; import SizeContext from '../SizeContext'; diff --git a/components/config-provider/hooks/useSize.ts b/components/config-provider/hooks/useSize.ts index e71ba78a6b..1fcd74f266 100644 --- a/components/config-provider/hooks/useSize.ts +++ b/components/config-provider/hooks/useSize.ts @@ -1,4 +1,5 @@ import React from 'react'; + import type { SizeType } from '../SizeContext'; import SizeContext from '../SizeContext'; diff --git a/components/date-picker/PickerButton.tsx b/components/date-picker/PickerButton.tsx index 43a9e1f002..97af6420ef 100644 --- a/components/date-picker/PickerButton.tsx +++ b/components/date-picker/PickerButton.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Button from '../button'; import type { ButtonProps } from '../button'; diff --git a/components/date-picker/__tests__/QuarterPicker.test.tsx b/components/date-picker/__tests__/QuarterPicker.test.tsx index 35bc5c25d9..5ee5526fb0 100644 --- a/components/date-picker/__tests__/QuarterPicker.test.tsx +++ b/components/date-picker/__tests__/QuarterPicker.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; + import DatePicker from '..'; -import { render } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; +import { render } from '../../../tests/utils'; const { QuarterPicker } = DatePicker; diff --git a/components/date-picker/__tests__/WeekPicker.test.tsx b/components/date-picker/__tests__/WeekPicker.test.tsx index a2f6480eee..52987803b8 100644 --- a/components/date-picker/__tests__/WeekPicker.test.tsx +++ b/components/date-picker/__tests__/WeekPicker.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import DatePicker from '..'; import focusTest from '../../../tests/shared/focusTest'; import { render, resetMockDate, setMockDate } from '../../../tests/utils'; diff --git a/components/date-picker/__tests__/other.test.tsx b/components/date-picker/__tests__/other.test.tsx index e4c0edeff1..35a9c8d422 100644 --- a/components/date-picker/__tests__/other.test.tsx +++ b/components/date-picker/__tests__/other.test.tsx @@ -1,14 +1,17 @@ import dayjs from 'dayjs'; + import 'dayjs/locale/zh-cn'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; + import React from 'react'; +import customParseFormat from 'dayjs/plugin/customParseFormat'; + import DatePicker from '..'; +import { render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; import type { Locale } from '../../locale'; -import locale from '../../locale/zh_CN'; import jaJP from '../../locale/ja_JP'; +import locale from '../../locale/zh_CN'; import zhTW from '../locale/zh_TW'; -import { render } from '../../../tests/utils'; dayjs.extend(customParseFormat); diff --git a/components/date-picker/demo/filled-debug.tsx b/components/date-picker/demo/filled-debug.tsx index b27b0f4bf7..8a7bc10ba1 100644 --- a/components/date-picker/demo/filled-debug.tsx +++ b/components/date-picker/demo/filled-debug.tsx @@ -1,7 +1,7 @@ import React from 'react'; +import { DatePicker, Space } from 'antd'; import dayjs from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; -import { DatePicker, Space } from 'antd'; dayjs.extend(customParseFormat); diff --git a/components/date-picker/demo/format.tsx b/components/date-picker/demo/format.tsx index ff37abed5f..db21bd61ad 100644 --- a/components/date-picker/demo/format.tsx +++ b/components/date-picker/demo/format.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; import type { DatePickerProps } from 'antd'; import { DatePicker, Space } from 'antd'; +import dayjs from 'dayjs'; +import customParseFormat from 'dayjs/plugin/customParseFormat'; dayjs.extend(customParseFormat); diff --git a/components/date-picker/demo/preset-ranges.tsx b/components/date-picker/demo/preset-ranges.tsx index cecbab0460..9022b17eba 100644 --- a/components/date-picker/demo/preset-ranges.tsx +++ b/components/date-picker/demo/preset-ranges.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import dayjs from 'dayjs'; -import type { Dayjs } from 'dayjs'; import type { TimeRangePickerProps } from 'antd'; import { DatePicker, Space } from 'antd'; +import dayjs from 'dayjs'; +import type { Dayjs } from 'dayjs'; const { RangePicker } = DatePicker; diff --git a/components/date-picker/demo/start-end.tsx b/components/date-picker/demo/start-end.tsx index 78247e07f3..909c2a0d1f 100644 --- a/components/date-picker/demo/start-end.tsx +++ b/components/date-picker/demo/start-end.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import type { Dayjs } from 'dayjs'; import { DatePicker, Space } from 'antd'; +import type { Dayjs } from 'dayjs'; const App: React.FC = () => { const [startValue, setStartValue] = useState(null); diff --git a/components/date-picker/design/demo/preset-time.tsx b/components/date-picker/design/demo/preset-time.tsx index 4268aca279..ae9d9917e7 100644 --- a/components/date-picker/design/demo/preset-time.tsx +++ b/components/date-picker/design/demo/preset-time.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import dayjs from 'dayjs'; import { DatePicker } from 'antd'; +import dayjs from 'dayjs'; const { _InternalPanelDoNotUseOrYouWillBeFired: PureDatePicker } = DatePicker; diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx index 398ac0e943..f13aa15ef6 100644 --- a/components/date-picker/generatePicker/generateRangePicker.tsx +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -4,7 +4,8 @@ import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined'; import SwapRightOutlined from '@ant-design/icons/SwapRightOutlined'; import classNames from 'classnames'; -import { RangePicker as RCRangePicker, type PickerRef } from 'rc-picker'; +import { RangePicker as RCRangePicker } from 'rc-picker'; +import type { PickerRef } from 'rc-picker'; import type { GenerateConfig } from 'rc-picker/lib/generate/index'; import { useZIndex } from '../../_util/hooks/useZIndex'; diff --git a/components/date-picker/generatePicker/generateSinglePicker.tsx b/components/date-picker/generatePicker/generateSinglePicker.tsx index 2e901e0542..f051d983d4 100644 --- a/components/date-picker/generatePicker/generateSinglePicker.tsx +++ b/components/date-picker/generatePicker/generateSinglePicker.tsx @@ -3,7 +3,8 @@ import { forwardRef, useContext, useImperativeHandle } from 'react'; import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined'; import classNames from 'classnames'; -import RCPicker, { type PickerRef } from 'rc-picker'; +import RCPicker from 'rc-picker'; +import type { PickerRef } from 'rc-picker'; import type { GenerateConfig } from 'rc-picker/lib/generate/index'; import type { PickerMode } from 'rc-picker/lib/interface'; diff --git a/components/date-picker/index.ts b/components/date-picker/index.ts index 9b5e3d2448..95174c3dc2 100755 --- a/components/date-picker/index.ts +++ b/components/date-picker/index.ts @@ -50,4 +50,4 @@ const PureRangePanel = genPurePanel(DatePicker.RangePicker, 'picker', null, post (DatePicker as DatePickerType)._InternalRangePanelDoNotUseOrYouWillBeFired = PureRangePanel; (DatePicker as DatePickerType).generatePicker = generatePicker; -export default (DatePicker as DatePickerType); +export default DatePicker as DatePickerType; diff --git a/components/date-picker/locale/ar_EG.ts b/components/date-picker/locale/ar_EG.ts index c42e75d605..4821eb7dd5 100644 --- a/components/date-picker/locale/ar_EG.ts +++ b/components/date-picker/locale/ar_EG.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ar_EG'; + import TimePickerLocale from '../../time-picker/locale/ar_EG'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/az_AZ.ts b/components/date-picker/locale/az_AZ.ts index 4128ce3d97..64284a79ea 100644 --- a/components/date-picker/locale/az_AZ.ts +++ b/components/date-picker/locale/az_AZ.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/az_AZ'; + import TimePickerLocale from '../../time-picker/locale/az_AZ'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/bg_BG.ts b/components/date-picker/locale/bg_BG.ts index 16de4f198c..a2f6c7cb6d 100644 --- a/components/date-picker/locale/bg_BG.ts +++ b/components/date-picker/locale/bg_BG.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/bg_BG'; + import TimePickerLocale from '../../time-picker/locale/bg_BG'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/bn_BD.ts b/components/date-picker/locale/bn_BD.ts index c856a99d69..9c6514cc87 100644 --- a/components/date-picker/locale/bn_BD.ts +++ b/components/date-picker/locale/bn_BD.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/bn_BD'; + import TimePickerLocale from '../../time-picker/locale/bn_BD'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/by_BY.ts b/components/date-picker/locale/by_BY.ts index 9043f04f61..01e2a58da4 100644 --- a/components/date-picker/locale/by_BY.ts +++ b/components/date-picker/locale/by_BY.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/by_BY'; + import TimePickerLocale from '../../time-picker/locale/by_BY'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ca_ES.ts b/components/date-picker/locale/ca_ES.ts index 61194e4f0f..6d6f38fad0 100644 --- a/components/date-picker/locale/ca_ES.ts +++ b/components/date-picker/locale/ca_ES.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ca_ES'; + import TimePickerLocale from '../../time-picker/locale/ca_ES'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/cs_CZ.ts b/components/date-picker/locale/cs_CZ.ts index 4b49a1e845..15d9f42037 100644 --- a/components/date-picker/locale/cs_CZ.ts +++ b/components/date-picker/locale/cs_CZ.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/cs_CZ'; + import TimePickerLocale from '../../time-picker/locale/cs_CZ'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/da_DK.ts b/components/date-picker/locale/da_DK.ts index 6067d49d47..d0a8feee79 100644 --- a/components/date-picker/locale/da_DK.ts +++ b/components/date-picker/locale/da_DK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/da_DK'; + import TimePickerLocale from '../../time-picker/locale/da_DK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/de_DE.ts b/components/date-picker/locale/de_DE.ts index 88fa6f5303..cb6ac02b45 100644 --- a/components/date-picker/locale/de_DE.ts +++ b/components/date-picker/locale/de_DE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/de_DE'; + import TimePickerLocale from '../../time-picker/locale/de_DE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/el_GR.ts b/components/date-picker/locale/el_GR.ts index 2de622f3db..ad84c24e95 100644 --- a/components/date-picker/locale/el_GR.ts +++ b/components/date-picker/locale/el_GR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/el_GR'; + import TimePickerLocale from '../../time-picker/locale/el_GR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/en_GB.ts b/components/date-picker/locale/en_GB.ts index d10f2eb274..ca1dc4caae 100644 --- a/components/date-picker/locale/en_GB.ts +++ b/components/date-picker/locale/en_GB.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/en_GB'; + import TimePickerLocale from '../../time-picker/locale/en_GB'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/en_US.ts b/components/date-picker/locale/en_US.ts index 971a2e0da4..c3df042abb 100644 --- a/components/date-picker/locale/en_US.ts +++ b/components/date-picker/locale/en_US.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/en_US'; + import TimePickerLocale from '../../time-picker/locale/en_US'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/es_ES.ts b/components/date-picker/locale/es_ES.ts index 059eb0a0b5..236379dbca 100644 --- a/components/date-picker/locale/es_ES.ts +++ b/components/date-picker/locale/es_ES.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/es_ES'; + import TimePickerLocale from '../../time-picker/locale/es_ES'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/et_EE.ts b/components/date-picker/locale/et_EE.ts index 06142f727d..c9fff83ce2 100644 --- a/components/date-picker/locale/et_EE.ts +++ b/components/date-picker/locale/et_EE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/et_EE'; + import TimePickerLocale from '../../time-picker/locale/et_EE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/eu_ES.ts b/components/date-picker/locale/eu_ES.ts index 103831dd33..8a428aa690 100644 --- a/components/date-picker/locale/eu_ES.ts +++ b/components/date-picker/locale/eu_ES.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/eu_ES'; + import TimePickerLocale from '../../time-picker/locale/eu_ES'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/fa_IR.ts b/components/date-picker/locale/fa_IR.ts index 768f3b356b..d6aca5ca59 100644 --- a/components/date-picker/locale/fa_IR.ts +++ b/components/date-picker/locale/fa_IR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/fa_IR'; + import TimePickerLocale from '../../time-picker/locale/fa_IR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/fi_FI.ts b/components/date-picker/locale/fi_FI.ts index e6750ad675..3dc5497d3f 100644 --- a/components/date-picker/locale/fi_FI.ts +++ b/components/date-picker/locale/fi_FI.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/fi_FI'; + import TimePickerLocale from '../../time-picker/locale/fi_FI'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/fr_BE.ts b/components/date-picker/locale/fr_BE.ts index e311c6dd0c..6a049eea90 100644 --- a/components/date-picker/locale/fr_BE.ts +++ b/components/date-picker/locale/fr_BE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/fr_BE'; + import TimePickerLocale from '../../time-picker/locale/fr_BE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/fr_CA.ts b/components/date-picker/locale/fr_CA.ts index fd6cb8d46a..f1ee94294e 100644 --- a/components/date-picker/locale/fr_CA.ts +++ b/components/date-picker/locale/fr_CA.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/fr_CA'; + import TimePickerLocale from '../../time-picker/locale/fr_CA'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/fr_FR.ts b/components/date-picker/locale/fr_FR.ts index 1583ca93f7..11b6721c2d 100644 --- a/components/date-picker/locale/fr_FR.ts +++ b/components/date-picker/locale/fr_FR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/fr_FR'; + import TimePickerLocale from '../../time-picker/locale/fr_FR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ga_IE.ts b/components/date-picker/locale/ga_IE.ts index 55b7d848d6..72290ce30d 100644 --- a/components/date-picker/locale/ga_IE.ts +++ b/components/date-picker/locale/ga_IE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ga_IE'; + import TimePickerLocale from '../../time-picker/locale/ga_IE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/gl_ES.ts b/components/date-picker/locale/gl_ES.ts index 823f131d5a..d7a3e4145c 100644 --- a/components/date-picker/locale/gl_ES.ts +++ b/components/date-picker/locale/gl_ES.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/gl_ES'; + import TimePickerLocale from '../../time-picker/locale/gl_ES'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/he_IL.ts b/components/date-picker/locale/he_IL.ts index 18c150ea2c..9572b71160 100644 --- a/components/date-picker/locale/he_IL.ts +++ b/components/date-picker/locale/he_IL.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/he_IL'; + import TimePickerLocale from '../../time-picker/locale/he_IL'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/hi_IN.ts b/components/date-picker/locale/hi_IN.ts index cd2a4c9289..e640a18cfe 100644 --- a/components/date-picker/locale/hi_IN.ts +++ b/components/date-picker/locale/hi_IN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/hi_IN'; + import TimePickerLocale from '../../time-picker/locale/hi_IN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/hr_HR.ts b/components/date-picker/locale/hr_HR.ts index 284479aea6..afcc347796 100644 --- a/components/date-picker/locale/hr_HR.ts +++ b/components/date-picker/locale/hr_HR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/hr_HR'; + import TimePickerLocale from '../../time-picker/locale/hr_HR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/hu_HU.ts b/components/date-picker/locale/hu_HU.ts index 8bd38e0532..b53ea4af85 100644 --- a/components/date-picker/locale/hu_HU.ts +++ b/components/date-picker/locale/hu_HU.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/hu_HU'; + import TimePickerLocale from '../../time-picker/locale/hu_HU'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/id_ID.ts b/components/date-picker/locale/id_ID.ts index 695a9b3a14..31b46025fb 100644 --- a/components/date-picker/locale/id_ID.ts +++ b/components/date-picker/locale/id_ID.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/id_ID'; + import TimePickerLocale from '../../time-picker/locale/id_ID'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/is_IS.ts b/components/date-picker/locale/is_IS.ts index 7909b4ede9..7e0db79f35 100644 --- a/components/date-picker/locale/is_IS.ts +++ b/components/date-picker/locale/is_IS.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/is_IS'; + import TimePickerLocale from '../../time-picker/locale/is_IS'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/it_IT.ts b/components/date-picker/locale/it_IT.ts index 15faca0213..c76a0da904 100644 --- a/components/date-picker/locale/it_IT.ts +++ b/components/date-picker/locale/it_IT.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/it_IT'; + import TimePickerLocale from '../../time-picker/locale/it_IT'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ja_JP.ts b/components/date-picker/locale/ja_JP.ts index ad750cb8db..13f7d34e87 100644 --- a/components/date-picker/locale/ja_JP.ts +++ b/components/date-picker/locale/ja_JP.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ja_JP'; + import TimePickerLocale from '../../time-picker/locale/ja_JP'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ka_GE.ts b/components/date-picker/locale/ka_GE.ts index 15029eb9f0..c230eb5cf5 100644 --- a/components/date-picker/locale/ka_GE.ts +++ b/components/date-picker/locale/ka_GE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ka_GE'; + import TimePickerLocale from '../../time-picker/locale/ka_GE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/kk_KZ.ts b/components/date-picker/locale/kk_KZ.ts index 8cd3277749..e36b2d4242 100644 --- a/components/date-picker/locale/kk_KZ.ts +++ b/components/date-picker/locale/kk_KZ.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/kk_KZ'; + import TimePickerLocale from '../../time-picker/locale/kk_KZ'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/km_KH.ts b/components/date-picker/locale/km_KH.ts index 84116b6b64..df0f0c8074 100644 --- a/components/date-picker/locale/km_KH.ts +++ b/components/date-picker/locale/km_KH.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/km_KH'; + import TimePickerLocale from '../../time-picker/locale/km_KH'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/kmr_IQ.ts b/components/date-picker/locale/kmr_IQ.ts index 993c4bed3c..ed94db86d7 100755 --- a/components/date-picker/locale/kmr_IQ.ts +++ b/components/date-picker/locale/kmr_IQ.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/kmr_IQ'; + import TimePickerLocale from '../../time-picker/locale/kmr_IQ'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/kn_IN.ts b/components/date-picker/locale/kn_IN.ts index 112605de49..51995d01a9 100644 --- a/components/date-picker/locale/kn_IN.ts +++ b/components/date-picker/locale/kn_IN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/kn_IN'; + import TimePickerLocale from '../../time-picker/locale/kn_IN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ko_KR.ts b/components/date-picker/locale/ko_KR.ts index 53f84cdeb3..387aa35432 100644 --- a/components/date-picker/locale/ko_KR.ts +++ b/components/date-picker/locale/ko_KR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ko_KR'; + import TimePickerLocale from '../../time-picker/locale/ko_KR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/lt_LT.ts b/components/date-picker/locale/lt_LT.ts index 56b00b5b20..c43c36b662 100644 --- a/components/date-picker/locale/lt_LT.ts +++ b/components/date-picker/locale/lt_LT.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/lt_LT'; + import TimePickerLocale from '../../time-picker/locale/lt_LT'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/lv_LV.ts b/components/date-picker/locale/lv_LV.ts index 8a2df8eea9..199078a97f 100644 --- a/components/date-picker/locale/lv_LV.ts +++ b/components/date-picker/locale/lv_LV.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/lv_LV'; + import TimePickerLocale from '../../time-picker/locale/lv_LV'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/mk_MK.ts b/components/date-picker/locale/mk_MK.ts index d5e794aa39..8f75fad279 100644 --- a/components/date-picker/locale/mk_MK.ts +++ b/components/date-picker/locale/mk_MK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/mk_MK'; + import TimePickerLocale from '../../time-picker/locale/mk_MK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ml_IN.ts b/components/date-picker/locale/ml_IN.ts index f001258ac6..ed0de87360 100644 --- a/components/date-picker/locale/ml_IN.ts +++ b/components/date-picker/locale/ml_IN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ml_IN'; + import TimePickerLocale from '../../time-picker/locale/ml_IN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/mn_MN.ts b/components/date-picker/locale/mn_MN.ts index 84d16fc892..302d7c043d 100644 --- a/components/date-picker/locale/mn_MN.ts +++ b/components/date-picker/locale/mn_MN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/mn_MN'; + import TimePickerLocale from '../../time-picker/locale/mn_MN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ms_MY.ts b/components/date-picker/locale/ms_MY.ts index 9a4850f679..eaaa1bb8c5 100644 --- a/components/date-picker/locale/ms_MY.ts +++ b/components/date-picker/locale/ms_MY.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ms_MY'; + import TimePickerLocale from '../../time-picker/locale/ms_MY'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/my_MM.ts b/components/date-picker/locale/my_MM.ts index 2657004ca5..be674486be 100644 --- a/components/date-picker/locale/my_MM.ts +++ b/components/date-picker/locale/my_MM.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/my_MM'; + import TimePickerLocale from '../../time-picker/locale/my_MM'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/nb_NO.ts b/components/date-picker/locale/nb_NO.ts index 498bf137c4..31404f9ce6 100644 --- a/components/date-picker/locale/nb_NO.ts +++ b/components/date-picker/locale/nb_NO.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/nb_NO'; + import TimePickerLocale from '../../time-picker/locale/nb_NO'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/nl_BE.ts b/components/date-picker/locale/nl_BE.ts index 67ca64a2c6..99fdaa2089 100644 --- a/components/date-picker/locale/nl_BE.ts +++ b/components/date-picker/locale/nl_BE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/nl_BE'; + import TimePickerLocale from '../../time-picker/locale/nl_BE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/nl_NL.ts b/components/date-picker/locale/nl_NL.ts index ba608b9038..fe9a993e40 100644 --- a/components/date-picker/locale/nl_NL.ts +++ b/components/date-picker/locale/nl_NL.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/nl_NL'; + import TimePickerLocale from '../../time-picker/locale/nl_NL'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/pl_PL.ts b/components/date-picker/locale/pl_PL.ts index fb5f09acc1..a9b4267a49 100644 --- a/components/date-picker/locale/pl_PL.ts +++ b/components/date-picker/locale/pl_PL.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/pl_PL'; + import TimePickerLocale from '../../time-picker/locale/pl_PL'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/pt_BR.ts b/components/date-picker/locale/pt_BR.ts index e67f323ac1..e1d679c2b3 100644 --- a/components/date-picker/locale/pt_BR.ts +++ b/components/date-picker/locale/pt_BR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/pt_BR'; + import TimePickerLocale from '../../time-picker/locale/pt_BR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/pt_PT.ts b/components/date-picker/locale/pt_PT.ts index 3f29e57dcf..ae24f82675 100644 --- a/components/date-picker/locale/pt_PT.ts +++ b/components/date-picker/locale/pt_PT.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/pt_PT'; + import TimePickerLocale from '../../time-picker/locale/pt_PT'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ro_RO.ts b/components/date-picker/locale/ro_RO.ts index e4361c1f1b..41c6aa2277 100644 --- a/components/date-picker/locale/ro_RO.ts +++ b/components/date-picker/locale/ro_RO.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ro_RO'; + import TimePickerLocale from '../../time-picker/locale/ro_RO'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ru_RU.ts b/components/date-picker/locale/ru_RU.ts index 44f40df517..16aedf7dad 100644 --- a/components/date-picker/locale/ru_RU.ts +++ b/components/date-picker/locale/ru_RU.ts @@ -1,6 +1,7 @@ /** Created by Andrey Gayvoronsky on 13/04/16. */ import CalendarLocale from 'rc-picker/lib/locale/ru_RU'; + import TimePickerLocale from '../../time-picker/locale/ru_RU'; import type { PickerLocale } from '../generatePicker'; @@ -17,7 +18,20 @@ const locale: PickerLocale = { rangeMonthPlaceholder: ['Начальный месяц', 'Конечный месяц'], rangeWeekPlaceholder: ['Начальная неделя', 'Конечная неделя'], shortWeekDays: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - shortMonths: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], + shortMonths: [ + 'Янв', + 'Фев', + 'Мар', + 'Апр', + 'Май', + 'Июн', + 'Июл', + 'Авг', + 'Сен', + 'Окт', + 'Ноя', + 'Дек', + ], ...CalendarLocale, }, timePickerLocale: { diff --git a/components/date-picker/locale/si_LK.ts b/components/date-picker/locale/si_LK.ts index 7408ebc55a..93ae699e8f 100644 --- a/components/date-picker/locale/si_LK.ts +++ b/components/date-picker/locale/si_LK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/si_LK'; + import TimePickerLocale from '../../time-picker/locale/si_LK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/sk_SK.ts b/components/date-picker/locale/sk_SK.ts index c187d60f30..ffae5eb464 100644 --- a/components/date-picker/locale/sk_SK.ts +++ b/components/date-picker/locale/sk_SK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/sk_SK'; + import TimePickerLocale from '../../time-picker/locale/sk_SK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/sr_RS.ts b/components/date-picker/locale/sr_RS.ts index 91db74ac9d..3cf038cb91 100644 --- a/components/date-picker/locale/sr_RS.ts +++ b/components/date-picker/locale/sr_RS.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/sr_RS'; + import TimePickerLocale from '../../time-picker/locale/sr_RS'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/sv_SE.ts b/components/date-picker/locale/sv_SE.ts index a8aaeaee52..3b6a1829ae 100644 --- a/components/date-picker/locale/sv_SE.ts +++ b/components/date-picker/locale/sv_SE.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/sv_SE'; + import TimePickerLocale from '../../time-picker/locale/sv_SE'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ta_IN.ts b/components/date-picker/locale/ta_IN.ts index 8f205c9400..e83539b1d8 100644 --- a/components/date-picker/locale/ta_IN.ts +++ b/components/date-picker/locale/ta_IN.ts @@ -1,5 +1,6 @@ // Tamil Locale added to rc-calendar import CalendarLocale from 'rc-picker/lib/locale/ta_IN'; + import TimePickerLocale from '../../time-picker/locale/ta_IN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/th_TH.ts b/components/date-picker/locale/th_TH.ts index 13cf6fb95a..73941d5f5e 100644 --- a/components/date-picker/locale/th_TH.ts +++ b/components/date-picker/locale/th_TH.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/th_TH'; + import TimePickerLocale from '../../time-picker/locale/th_TH'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/tk_TK.ts b/components/date-picker/locale/tk_TK.ts index ed69905397..5d1da8f792 100644 --- a/components/date-picker/locale/tk_TK.ts +++ b/components/date-picker/locale/tk_TK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/tk_TK'; + import TimePickerLocale from '../../time-picker/locale/tk_TK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/tr_TR.ts b/components/date-picker/locale/tr_TR.ts index 87b88464e7..ab1ef4b4ea 100644 --- a/components/date-picker/locale/tr_TR.ts +++ b/components/date-picker/locale/tr_TR.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/tr_TR'; + import TimePickerLocale from '../../time-picker/locale/tr_TR'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/uk_UA.ts b/components/date-picker/locale/uk_UA.ts index 63957833d8..cdd66c62c4 100644 --- a/components/date-picker/locale/uk_UA.ts +++ b/components/date-picker/locale/uk_UA.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/uk_UA'; + import TimePickerLocale from '../../time-picker/locale/uk_UA'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/ur_PK.ts b/components/date-picker/locale/ur_PK.ts index f003140765..3e8e7e1e2e 100644 --- a/components/date-picker/locale/ur_PK.ts +++ b/components/date-picker/locale/ur_PK.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/ur_PK'; + import TimePickerLocale from '../../time-picker/locale/ur_PK'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/vi_VN.ts b/components/date-picker/locale/vi_VN.ts index cfa395cf75..417f5d0939 100644 --- a/components/date-picker/locale/vi_VN.ts +++ b/components/date-picker/locale/vi_VN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/vi_VN'; + import TimePickerLocale from '../../time-picker/locale/vi_VN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/zh_CN.ts b/components/date-picker/locale/zh_CN.ts index 87f5df5fd5..670f541386 100644 --- a/components/date-picker/locale/zh_CN.ts +++ b/components/date-picker/locale/zh_CN.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/zh_CN'; + import TimePickerLocale from '../../time-picker/locale/zh_CN'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/locale/zh_TW.ts b/components/date-picker/locale/zh_TW.ts index 7744867c72..925dec02ed 100644 --- a/components/date-picker/locale/zh_TW.ts +++ b/components/date-picker/locale/zh_TW.ts @@ -1,4 +1,5 @@ import CalendarLocale from 'rc-picker/lib/locale/zh_TW'; + import TimePickerLocale from '../../time-picker/locale/zh_TW'; import type { PickerLocale } from '../generatePicker'; diff --git a/components/date-picker/style/multiple.ts b/components/date-picker/style/multiple.ts index eeb96e7610..5456c0e439 100644 --- a/components/date-picker/style/multiple.ts +++ b/components/date-picker/style/multiple.ts @@ -2,7 +2,8 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; import { genOverflowStyle, getMultipleSelectorUnit } from '../../select/style/multiple'; -import { mergeToken, type GenerateStyle } from '../../theme/internal'; +import { mergeToken } from '../../theme/internal'; +import type { GenerateStyle } from '../../theme/internal'; import type { PickerToken } from './token'; const genSize = (token: PickerToken, suffix?: string): CSSInterpolation => { diff --git a/components/date-picker/style/panel.ts b/components/date-picker/style/panel.ts index 29cb910d15..96813cf71e 100644 --- a/components/date-picker/style/panel.ts +++ b/components/date-picker/style/panel.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/date-picker/style/variants.ts b/components/date-picker/style/variants.ts index 75dd1655e2..0b5cf3c8f8 100644 --- a/components/date-picker/style/variants.ts +++ b/components/date-picker/style/variants.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { genBorderlessStyle, genFilledStyle, genOutlinedStyle } from '../../input/style/variants'; import type { PickerToken } from './token'; diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index 4e330d63e4..c9061a5d1b 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; function notEmpty(val: any) { return val !== undefined && val !== null; diff --git a/components/descriptions/demo/size.tsx b/components/descriptions/demo/size.tsx index 428568ebc3..0f06b6c456 100644 --- a/components/descriptions/demo/size.tsx +++ b/components/descriptions/demo/size.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { Button, Descriptions, Radio } from 'antd'; -import type { RadioChangeEvent, DescriptionsProps } from 'antd'; +import type { DescriptionsProps, RadioChangeEvent } from 'antd'; const borderedItems: DescriptionsProps['items'] = [ { diff --git a/components/descriptions/hooks/useItems.ts b/components/descriptions/hooks/useItems.ts index db0917772a..f06ceb0117 100644 --- a/components/descriptions/hooks/useItems.ts +++ b/components/descriptions/hooks/useItems.ts @@ -2,7 +2,8 @@ import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import type { DescriptionsItemType, InternalDescriptionsItemType } from '..'; -import { matchScreen, type ScreenMap } from '../../_util/responsiveObserver'; +import { matchScreen } from '../../_util/responsiveObserver'; +import type { ScreenMap } from '../../_util/responsiveObserver'; // Convert children into items const transChildren2Items = (childNodes?: React.ReactNode) => diff --git a/components/descriptions/style/index.ts b/components/descriptions/style/index.ts index d34fc297cc..c37f44b3da 100644 --- a/components/descriptions/style/index.ts +++ b/components/descriptions/style/index.ts @@ -1,4 +1,5 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { resetComponent, textEllipsis } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/divider/__tests__/index.test.tsx b/components/divider/__tests__/index.test.tsx index 367b319105..31d3c46dfa 100644 --- a/components/divider/__tests__/index.test.tsx +++ b/components/divider/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Divider from '..'; import mountTest from '../../../tests/shared/mountTest'; import { render } from '../../../tests/utils'; diff --git a/components/drawer/DrawerPanel.tsx b/components/drawer/DrawerPanel.tsx index 8fe33163b3..31ccb78e33 100644 --- a/components/drawer/DrawerPanel.tsx +++ b/components/drawer/DrawerPanel.tsx @@ -2,7 +2,8 @@ import * as React from 'react'; import classNames from 'classnames'; import type { DrawerProps as RCDrawerProps } from 'rc-drawer'; -import useClosable, { pickClosable, type ClosableType } from '../_util/hooks/useClosable'; +import useClosable, { pickClosable } from '../_util/hooks/useClosable'; +import type { ClosableType } from '../_util/hooks/useClosable'; import { ConfigContext } from '../config-provider'; export interface DrawerClassNames extends NonNullable { diff --git a/components/drawer/__tests__/DrawerEvent.test.tsx b/components/drawer/__tests__/DrawerEvent.test.tsx index ff2f07bded..d9ae9f1fd7 100644 --- a/components/drawer/__tests__/DrawerEvent.test.tsx +++ b/components/drawer/__tests__/DrawerEvent.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { DrawerProps } from '..'; import Drawer from '..'; import { act, fireEvent, render } from '../../../tests/utils'; diff --git a/components/drawer/__tests__/MultiDrawer.test.tsx b/components/drawer/__tests__/MultiDrawer.test.tsx index 4238ec6a40..b7632b48a4 100644 --- a/components/drawer/__tests__/MultiDrawer.test.tsx +++ b/components/drawer/__tests__/MultiDrawer.test.tsx @@ -1,5 +1,6 @@ -import type { DrawerPopupProps } from 'rc-drawer/lib/DrawerPopup'; import React, { useState } from 'react'; +import type { DrawerPopupProps } from 'rc-drawer/lib/DrawerPopup'; + import Drawer from '..'; import { fireEvent, render } from '../../../tests/utils'; import Button from '../../button'; diff --git a/components/drawer/__tests__/demo-extend.test.tsx b/components/drawer/__tests__/demo-extend.test.tsx index 5dd0a52c33..ccf65344a9 100644 --- a/components/drawer/__tests__/demo-extend.test.tsx +++ b/components/drawer/__tests__/demo-extend.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import { extendTest } from '../../../tests/shared/demoTest'; jest.mock('rc-drawer', () => { diff --git a/components/drawer/__tests__/type.test.tsx b/components/drawer/__tests__/type.test.tsx index df2f28ebfb..edc077a978 100644 --- a/components/drawer/__tests__/type.test.tsx +++ b/components/drawer/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Drawer from '..'; describe('Drawer.typescript', () => { diff --git a/components/drawer/demo/scroll-debug.tsx b/components/drawer/demo/scroll-debug.tsx index 37880eba51..c333488f14 100644 --- a/components/drawer/demo/scroll-debug.tsx +++ b/components/drawer/demo/scroll-debug.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Switch, Space, Drawer, Modal } from 'antd'; +import { Drawer, Modal, Space, Switch } from 'antd'; const App: React.FC = () => { const [drawer, setDrawer] = useState(false); diff --git a/components/dropdown/__tests__/demo.test.tsx b/components/dropdown/__tests__/demo.test.tsx index 643f2fd32b..8cdbcc9d8f 100644 --- a/components/dropdown/__tests__/demo.test.tsx +++ b/components/dropdown/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('dropdown', { diff --git a/components/dropdown/demo/custom-dropdown.tsx b/components/dropdown/demo/custom-dropdown.tsx index 18c712f278..bdb713cd66 100644 --- a/components/dropdown/demo/custom-dropdown.tsx +++ b/components/dropdown/demo/custom-dropdown.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { DownOutlined } from '@ant-design/icons'; -import { Dropdown, Space, Divider, Button, theme } from 'antd'; +import { Button, Divider, Dropdown, Space, theme } from 'antd'; import type { MenuProps } from 'antd'; const { useToken } = theme; diff --git a/components/dropdown/demo/icon-debug.tsx b/components/dropdown/demo/icon-debug.tsx index 5d41d75043..0903b09bc4 100644 --- a/components/dropdown/demo/icon-debug.tsx +++ b/components/dropdown/demo/icon-debug.tsx @@ -1,5 +1,5 @@ -import { DownOutlined } from '@ant-design/icons'; import React from 'react'; +import { DownOutlined } from '@ant-design/icons'; import { Dropdown, Space } from 'antd'; const App: React.FC = () => ( diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index 69028aee5a..95ea68f807 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -1,14 +1,14 @@ -import classNames from 'classnames'; import * as React from 'react'; import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; +import classNames from 'classnames'; + import Button from '../button'; +import type { ButtonHTMLType, ButtonProps } from '../button'; +import type { ButtonGroupProps } from '../button/button-group'; import { ConfigContext } from '../config-provider'; import Space from '../space'; import { useCompactItemContext } from '../space/Compact'; import Dropdown from './dropdown'; - -import type { ButtonProps, ButtonHTMLType } from '../button'; -import type { ButtonGroupProps } from '../button/button-group'; import type { DropdownProps } from './dropdown'; export type DropdownButtonType = 'default' | 'primary' | 'dashed' | 'link' | 'text'; diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 38a38941b3..56f31eb113 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -15,12 +15,12 @@ import { cloneElement } from '../_util/reactNode'; import { devUseWarning } from '../_util/warning'; import zIndexContext from '../_util/zindexContext'; import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import type { MenuProps } from '../menu'; import Menu from '../menu'; import { OverrideProvider } from '../menu/OverrideContext'; import { useToken } from '../theme/internal'; import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; const Placements = [ 'topLeft', diff --git a/components/dropdown/style/index.ts b/components/dropdown/style/index.ts index cf3dd59538..97acf59cc7 100644 --- a/components/dropdown/style/index.ts +++ b/components/dropdown/style/index.ts @@ -1,3 +1,6 @@ +import type { CSSProperties } from 'react'; +import { unit } from '@ant-design/cssinjs'; + import { genFocusStyle, resetComponent } from '../../style'; import { initMoveMotion, @@ -10,13 +13,11 @@ import { } from '../../style/motion'; import type { ArrowOffsetToken } from '../../style/placementArrow'; import getArrowStyle, { getArrowOffsetToken } from '../../style/placementArrow'; +import type { ArrowToken } from '../../style/roundedArrow'; +import { getArrowToken } from '../../style/roundedArrow'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; import genStatusStyle from './status'; -import type { ArrowToken } from '../../style/roundedArrow'; -import { getArrowToken } from '../../style/roundedArrow'; -import type { CSSProperties } from 'react'; -import { unit } from '@ant-design/cssinjs'; export interface ComponentToken extends ArrowToken, ArrowOffsetToken { /** diff --git a/components/empty/__tests__/index.test.tsx b/components/empty/__tests__/index.test.tsx index 0f466298dc..550cc10159 100644 --- a/components/empty/__tests__/index.test.tsx +++ b/components/empty/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Empty from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/empty/empty.tsx b/components/empty/empty.tsx index 75a4aa5c0b..e7ffca1877 100644 --- a/components/empty/empty.tsx +++ b/components/empty/empty.tsx @@ -1,5 +1,6 @@ -import { TinyColor } from '@ctrl/tinycolor'; import * as React from 'react'; +import { TinyColor } from '@ctrl/tinycolor'; + import { useToken } from '../theme/internal'; const Empty: React.FC = () => { diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 243dbcaa14..e6d5a7fb31 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,10 +1,10 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { ConfigContext } from '../config-provider'; import { useLocale } from '../locale'; import DefaultEmptyImg from './empty'; import SimpleEmptyImg from './simple'; - import useStyle from './style'; const defaultEmptyImg = ; diff --git a/components/empty/simple.tsx b/components/empty/simple.tsx index f0b0dda188..b7be56b637 100644 --- a/components/empty/simple.tsx +++ b/components/empty/simple.tsx @@ -1,6 +1,7 @@ -import { TinyColor } from '@ctrl/tinycolor'; import * as React from 'react'; import { useMemo } from 'react'; +import { TinyColor } from '@ctrl/tinycolor'; + import { useToken } from '../theme/internal'; const Simple: React.FC = () => { diff --git a/components/empty/style/index.ts b/components/empty/style/index.ts index d73073154a..dc28c5bf14 100644 --- a/components/empty/style/index.ts +++ b/components/empty/style/index.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { FullToken, GenerateStyle } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/float-button/FloatButtonContent.tsx b/components/float-button/FloatButtonContent.tsx index a98e03a823..3e388c84e9 100644 --- a/components/float-button/FloatButtonContent.tsx +++ b/components/float-button/FloatButtonContent.tsx @@ -1,6 +1,7 @@ import React, { memo } from 'react'; import FileTextOutlined from '@ant-design/icons/FileTextOutlined'; import classNames from 'classnames'; + import type { FloatButtonContentProps } from './interface'; const FloatButtonContent: React.FC = (props) => { diff --git a/components/float-button/PurePanel.tsx b/components/float-button/PurePanel.tsx index cba64c4024..f7780be047 100644 --- a/components/float-button/PurePanel.tsx +++ b/components/float-button/PurePanel.tsx @@ -1,6 +1,7 @@ /* eslint-disable react/no-array-index-key */ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { ConfigContext } from '../config-provider'; import BackTop from './BackTop'; import FloatButton, { floatButtonPrefixCls } from './FloatButton'; diff --git a/components/float-button/__tests__/group.test.tsx b/components/float-button/__tests__/group.test.tsx index 3a62049b17..799a164e52 100644 --- a/components/float-button/__tests__/group.test.tsx +++ b/components/float-button/__tests__/group.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import FloatButton from '..'; import { fireEvent, render } from '../../../tests/utils'; diff --git a/components/float-button/context.ts b/components/float-button/context.ts index 132eda1c27..798cf9f012 100644 --- a/components/float-button/context.ts +++ b/components/float-button/context.ts @@ -1,4 +1,5 @@ import React from 'react'; + import type { FloatButtonShape } from './interface'; const FloatButtonGroupContext = React.createContext(undefined); diff --git a/components/float-button/demo/badge.tsx b/components/float-button/demo/badge.tsx index 00ae514332..879f95a867 100644 --- a/components/float-button/demo/badge.tsx +++ b/components/float-button/demo/badge.tsx @@ -1,5 +1,5 @@ -import { QuestionCircleOutlined } from '@ant-design/icons'; import React from 'react'; +import { QuestionCircleOutlined } from '@ant-design/icons'; import { FloatButton } from 'antd'; const App: React.FC = () => ( diff --git a/components/float-button/demo/controlled.tsx b/components/float-button/demo/controlled.tsx index 90681b604b..95489b572e 100644 --- a/components/float-button/demo/controlled.tsx +++ b/components/float-button/demo/controlled.tsx @@ -1,5 +1,5 @@ -import { CommentOutlined, CustomerServiceOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { CommentOutlined, CustomerServiceOutlined } from '@ant-design/icons'; import { FloatButton, Switch } from 'antd'; const App: React.FC = () => { diff --git a/components/float-button/demo/group-menu.tsx b/components/float-button/demo/group-menu.tsx index 1804b11595..302600fc6f 100644 --- a/components/float-button/demo/group-menu.tsx +++ b/components/float-button/demo/group-menu.tsx @@ -1,5 +1,5 @@ -import { CommentOutlined, CustomerServiceOutlined } from '@ant-design/icons'; import React from 'react'; +import { CommentOutlined, CustomerServiceOutlined } from '@ant-design/icons'; import { FloatButton } from 'antd'; const App: React.FC = () => ( diff --git a/components/float-button/demo/render-panel.tsx b/components/float-button/demo/render-panel.tsx index 175f425f49..9c3c35e056 100644 --- a/components/float-button/demo/render-panel.tsx +++ b/components/float-button/demo/render-panel.tsx @@ -1,5 +1,5 @@ -import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons'; import React from 'react'; +import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons'; import { FloatButton } from 'antd'; /** Test usage. Do not use in your production. */ diff --git a/components/float-button/style/index.ts b/components/float-button/style/index.ts index cd37463073..79090d2396 100644 --- a/components/float-button/style/index.ts +++ b/components/float-button/style/index.ts @@ -1,5 +1,6 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes, unit } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import { initFadeMotion } from '../../style/motion/fade'; import { initMotion } from '../../style/motion/motion'; diff --git a/components/form/ErrorList.tsx b/components/form/ErrorList.tsx index e9f88e53a0..9723099f5c 100644 --- a/components/form/ErrorList.tsx +++ b/components/form/ErrorList.tsx @@ -1,15 +1,15 @@ +import * as React from 'react'; +import { useMemo } from 'react'; import classNames from 'classnames'; import type { CSSMotionProps } from 'rc-motion'; import CSSMotion, { CSSMotionList } from 'rc-motion'; -import * as React from 'react'; -import { useMemo } from 'react'; + import initCollapseMotion from '../_util/motion'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import { FormItemPrefixContext } from './context'; import type { ValidateStatus } from './FormItem'; import useDebounce from './hooks/useDebounce'; - import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; const EMPTY_LIST: React.ReactNode[] = []; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 1b39e023c8..64b939217c 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -16,7 +16,8 @@ import type { ColProps } from '../grid/col'; import type { FormContextProps } from './context'; import { FormContext, FormProvider, VariantContext } from './context'; import type { FeedbackIcons } from './FormItem'; -import useForm, { type FormInstance } from './hooks/useForm'; +import useForm from './hooks/useForm'; +import type { FormInstance } from './hooks/useForm'; import useFormWarning from './hooks/useFormWarning'; import type { Variant } from './hooks/useVariants'; import type { FormLabelAlign } from './interface'; diff --git a/components/form/FormItem/StatusProvider.tsx b/components/form/FormItem/StatusProvider.tsx index ca9c79b413..71dfba54f2 100644 --- a/components/form/FormItem/StatusProvider.tsx +++ b/components/form/FormItem/StatusProvider.tsx @@ -7,7 +7,8 @@ import classNames from 'classnames'; import type { Meta } from 'rc-field-form/lib/interface'; import type { FeedbackIcons, ValidateStatus } from '.'; -import { FormContext, FormItemInputContext, type FormItemStatusContextProps } from '../context'; +import { FormContext, FormItemInputContext } from '../context'; +import type { FormItemStatusContextProps } from '../context'; import { getStatus } from '../util'; const iconMap = { diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index c3115c7c56..033c938170 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -1,10 +1,11 @@ +import * as React from 'react'; import QuestionCircleOutlined from '@ant-design/icons/QuestionCircleOutlined'; import classNames from 'classnames'; -import * as React from 'react'; + import type { ColProps } from '../grid/col'; import Col from '../grid/col'; -import defaultLocale from '../locale/en_US'; import { useLocale } from '../locale'; +import defaultLocale from '../locale/en_US'; import type { TooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; import type { FormContextProps } from './context'; diff --git a/components/form/__tests__/demo.test.tsx b/components/form/__tests__/demo.test.tsx index c60b1f56ee..745650d827 100644 --- a/components/form/__tests__/demo.test.tsx +++ b/components/form/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('form', { skip: ['complex-form-control.tsx', 'dep-debug.tsx', 'component-token.tsx'] }); diff --git a/components/form/__tests__/list-noStyle.test.tsx b/components/form/__tests__/list-noStyle.test.tsx index 89ed93b88b..248c3c4732 100644 --- a/components/form/__tests__/list-noStyle.test.tsx +++ b/components/form/__tests__/list-noStyle.test.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; + import Form from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import Input from '../../input'; diff --git a/components/form/__tests__/list.test.tsx b/components/form/__tests__/list.test.tsx index 1a2ca95660..dffd7ab997 100644 --- a/components/form/__tests__/list.test.tsx +++ b/components/form/__tests__/list.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { FormListFieldData, FormListOperation } from '..'; import Form from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; diff --git a/components/form/__tests__/ref.test.tsx b/components/form/__tests__/ref.test.tsx index 7f0dd0091a..a73169d1e2 100644 --- a/components/form/__tests__/ref.test.tsx +++ b/components/form/__tests__/ref.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Form from '..'; import { fireEvent, render } from '../../../tests/utils'; import Button from '../../button'; diff --git a/components/form/__tests__/type.test.tsx b/components/form/__tests__/type.test.tsx index e1f8682a1c..9bbff34d91 100644 --- a/components/form/__tests__/type.test.tsx +++ b/components/form/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef } from 'react'; + import type { FormInstance } from '..'; import Form from '..'; import Input from '../../input'; diff --git a/components/form/context.tsx b/components/form/context.tsx index be27ac2e5c..3f129bbcf9 100644 --- a/components/form/context.tsx +++ b/components/form/context.tsx @@ -8,9 +8,9 @@ import omit from 'rc-util/lib/omit'; import type { ColProps } from '../grid/col'; import type { FormInstance, RequiredMark } from './Form'; -import type { ValidateStatus, FeedbackIcons } from './FormItem'; -import type { FormLabelAlign } from './interface'; +import type { FeedbackIcons, ValidateStatus } from './FormItem'; import type { Variant } from './hooks/useVariants'; +import type { FormLabelAlign } from './interface'; /** Form Context. Set top form style and pass to Form Item usage. */ export interface FormContextProps { diff --git a/components/form/demo/basic.tsx b/components/form/demo/basic.tsx index 1f0c76a068..06c7fdf74c 100644 --- a/components/form/demo/basic.tsx +++ b/components/form/demo/basic.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Button, Checkbox, Form, type FormProps, Input } from 'antd'; +import type { FormProps } from 'antd'; +import { Button, Checkbox, Form, Input } from 'antd'; type FieldType = { username?: string; @@ -7,11 +8,11 @@ type FieldType = { remember?: string; }; -const onFinish: FormProps["onFinish"] = (values) => { +const onFinish: FormProps['onFinish'] = (values) => { console.log('Success:', values); }; -const onFinishFailed: FormProps["onFinishFailed"] = (errorInfo) => { +const onFinishFailed: FormProps['onFinishFailed'] = (errorInfo) => { console.log('Failed:', errorInfo); }; diff --git a/components/form/demo/col-24-debug.tsx b/components/form/demo/col-24-debug.tsx index 43de7f2b78..daacdc3fbe 100644 --- a/components/form/demo/col-24-debug.tsx +++ b/components/form/demo/col-24-debug.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Select, Form, Input, Divider } from 'antd'; +import { Button, Divider, Form, Input, Select } from 'antd'; const sharedItem = ( ([]); diff --git a/components/form/demo/validate-other.tsx b/components/form/demo/validate-other.tsx index 8798df0394..e53cece4df 100644 --- a/components/form/demo/validate-other.tsx +++ b/components/form/demo/validate-other.tsx @@ -1,5 +1,5 @@ -import { InboxOutlined, UploadOutlined } from '@ant-design/icons'; import React from 'react'; +import { InboxOutlined, UploadOutlined } from '@ant-design/icons'; import { Button, Checkbox, diff --git a/components/form/hooks/useChildren.ts b/components/form/hooks/useChildren.ts index 2f40fe53d6..dac4b48b57 100644 --- a/components/form/hooks/useChildren.ts +++ b/components/form/hooks/useChildren.ts @@ -1,4 +1,5 @@ import toArray from 'rc-util/lib/Children/toArray'; + import type { FormItemProps } from '../FormItem'; export default function useChildren( diff --git a/components/form/hooks/useForm.ts b/components/form/hooks/useForm.ts index a553a58902..5905cbb981 100644 --- a/components/form/hooks/useForm.ts +++ b/components/form/hooks/useForm.ts @@ -1,7 +1,8 @@ +import * as React from 'react'; import type { FormInstance as RcFormInstance } from 'rc-field-form'; import { useForm as useRcForm } from 'rc-field-form'; -import * as React from 'react'; import scrollIntoView from 'scroll-into-view-if-needed'; + import type { InternalNamePath, NamePath, ScrollOptions } from '../interface'; import { getFieldId, toArray } from '../util'; diff --git a/components/form/hooks/useFormInstance.ts b/components/form/hooks/useFormInstance.ts index d6b63f4ed3..4884206a45 100644 --- a/components/form/hooks/useFormInstance.ts +++ b/components/form/hooks/useFormInstance.ts @@ -1,4 +1,5 @@ import { useContext } from 'react'; + import { FormContext } from '../context'; import type { FormInstance } from './useForm'; diff --git a/components/form/hooks/useFrameState.ts b/components/form/hooks/useFrameState.ts index 12fbc587c1..6246bbda56 100644 --- a/components/form/hooks/useFrameState.ts +++ b/components/form/hooks/useFrameState.ts @@ -1,6 +1,6 @@ -import raf from 'rc-util/lib/raf'; import * as React from 'react'; import { useRef } from 'react'; +import raf from 'rc-util/lib/raf'; type Updater = (prev?: ValueType) => ValueType; diff --git a/components/form/hooks/useItemRef.ts b/components/form/hooks/useItemRef.ts index e42890677d..3f28725c37 100644 --- a/components/form/hooks/useItemRef.ts +++ b/components/form/hooks/useItemRef.ts @@ -1,5 +1,6 @@ -import { composeRef } from 'rc-util/lib/ref'; import * as React from 'react'; +import { composeRef } from 'rc-util/lib/ref'; + import { FormContext } from '../context'; import type { InternalNamePath } from '../interface'; diff --git a/components/form/hooks/useVariants.ts b/components/form/hooks/useVariants.ts index d5abc18913..485d3b846e 100644 --- a/components/form/hooks/useVariants.ts +++ b/components/form/hooks/useVariants.ts @@ -1,4 +1,5 @@ import { useContext } from 'react'; + import { VariantContext } from '../context'; export const Variants = ['outlined', 'borderless', 'filled'] as const; diff --git a/components/form/index.ts b/components/form/index.ts index 1438f9f4f9..56e803b6b2 100644 --- a/components/form/index.ts +++ b/components/form/index.ts @@ -1,14 +1,15 @@ import type { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface'; + import warning from '../_util/warning'; -import ErrorList, { type ErrorListProps } from './ErrorList'; -import InternalForm, { useForm, useWatch, type FormInstance, type FormProps } from './Form'; -import Item, { type FormItemProps } from './FormItem'; -import List, { - type FormListFieldData, - type FormListOperation, - type FormListProps, -} from './FormList'; import { FormProvider } from './context'; +import ErrorList from './ErrorList'; +import type { ErrorListProps } from './ErrorList'; +import InternalForm, { useForm, useWatch } from './Form'; +import type { FormInstance, FormProps } from './Form'; +import Item from './FormItem'; +import type { FormItemProps } from './FormItem'; +import List from './FormList'; +import type { FormListFieldData, FormListOperation, FormListProps } from './FormList'; import useFormInstance from './hooks/useFormInstance'; type InternalFormType = typeof InternalForm; diff --git a/components/form/style/fallbackCmp.ts b/components/form/style/fallbackCmp.ts index cf3e113365..4f0389651f 100644 --- a/components/form/style/fallbackCmp.ts +++ b/components/form/style/fallbackCmp.ts @@ -4,8 +4,10 @@ */ // Style as inline component -import { prepareToken, type FormToken } from '.'; -import { genSubStyleComponent, type GenerateStyle } from '../../theme/internal'; +import { prepareToken } from '.'; +import type { FormToken } from '.'; +import { genSubStyleComponent } from '../../theme/internal'; +import type { GenerateStyle } from '../../theme/internal'; // ============================= Fallback ============================= const genFallbackStyle: GenerateStyle = (token) => { diff --git a/components/form/validateMessagesContext.tsx b/components/form/validateMessagesContext.tsx index c95aba3326..53ca868277 100644 --- a/components/form/validateMessagesContext.tsx +++ b/components/form/validateMessagesContext.tsx @@ -1,5 +1,5 @@ -import type { ValidateMessages } from 'rc-field-form/lib/interface'; import { createContext } from 'react'; +import type { ValidateMessages } from 'rc-field-form/lib/interface'; // ZombieJ: We export single file here since // ConfigProvider use this which will make loop deps diff --git a/components/grid/__tests__/cached-row-context.test.tsx b/components/grid/__tests__/cached-row-context.test.tsx index 18b7f79b0f..9077807065 100644 --- a/components/grid/__tests__/cached-row-context.test.tsx +++ b/components/grid/__tests__/cached-row-context.test.tsx @@ -1,7 +1,8 @@ import React, { memo, useContext } from 'react'; + +import { fireEvent, pureRender } from '../../../tests/utils'; import Row from '../row'; import RowContext from '../RowContext'; -import { fireEvent, pureRender } from '../../../tests/utils'; let innerCount = 0; let outerCount = 0; diff --git a/components/grid/hooks/useBreakpoint.tsx b/components/grid/hooks/useBreakpoint.tsx index fde0d87152..5b08dfb437 100644 --- a/components/grid/hooks/useBreakpoint.tsx +++ b/components/grid/hooks/useBreakpoint.tsx @@ -1,5 +1,6 @@ import { useRef } from 'react'; import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; + import useForceUpdate from '../../_util/hooks/useForceUpdate'; import type { ScreenMap } from '../../_util/responsiveObserver'; import useResponsiveObserver from '../../_util/responsiveObserver'; diff --git a/components/grid/style/index.ts b/components/grid/style/index.ts index 7a3f98497d..0076a03677 100644 --- a/components/grid/style/index.ts +++ b/components/grid/style/index.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/icon/__tests__/index.test.tsx b/components/icon/__tests__/index.test.tsx index b1e4b36610..c25761b3be 100644 --- a/components/icon/__tests__/index.test.tsx +++ b/components/icon/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Icon from '..'; import { render } from '../../../tests/utils'; diff --git a/components/image/demo/controlled-preview.tsx b/components/image/demo/controlled-preview.tsx index e85032c70f..252e282934 100644 --- a/components/image/demo/controlled-preview.tsx +++ b/components/image/demo/controlled-preview.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Button, InputNumber, Image } from 'antd'; +import { Button, Image, InputNumber } from 'antd'; const App: React.FC = () => { const [visible, setVisible] = useState(false); diff --git a/components/image/demo/toolbarRender.tsx b/components/image/demo/toolbarRender.tsx index 14fcad7e0b..6cc9bef026 100644 --- a/components/image/demo/toolbarRender.tsx +++ b/components/image/demo/toolbarRender.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { DownloadOutlined, RotateLeftOutlined, @@ -6,7 +7,6 @@ import { ZoomInOutlined, ZoomOutOutlined, } from '@ant-design/icons'; -import React from 'react'; import { Image, Space } from 'antd'; const src = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'; diff --git a/components/image/style/index.ts b/components/image/style/index.ts index 95ebb4f7a8..09e39bde98 100644 --- a/components/image/style/index.ts +++ b/components/image/style/index.ts @@ -1,6 +1,7 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; + import { genModalMaskStyle } from '../../modal/style'; import { textEllipsis } from '../../style'; import { initFadeMotion, initZoomMotion } from '../../style/motion'; diff --git a/components/input-number/__tests__/addon.test.tsx b/components/input-number/__tests__/addon.test.tsx index c2fc04a0b1..d5489285ad 100644 --- a/components/input-number/__tests__/addon.test.tsx +++ b/components/input-number/__tests__/addon.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import InputNumber from '..'; import { render } from '../../../tests/utils'; diff --git a/components/input-number/__tests__/demo.test.tsx b/components/input-number/__tests__/demo.test.tsx index da9f568ce0..172031a8d8 100644 --- a/components/input-number/__tests__/demo.test.tsx +++ b/components/input-number/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('input-number', { diff --git a/components/input-number/__tests__/index.test.tsx b/components/input-number/__tests__/index.test.tsx index 576da153fd..f6494c21cd 100644 --- a/components/input-number/__tests__/index.test.tsx +++ b/components/input-number/__tests__/index.test.tsx @@ -1,5 +1,6 @@ -import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; import React from 'react'; +import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; + import InputNumber from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/input-number/__tests__/prefix.test.tsx b/components/input-number/__tests__/prefix.test.tsx index e176e649ed..ae320fcadd 100644 --- a/components/input-number/__tests__/prefix.test.tsx +++ b/components/input-number/__tests__/prefix.test.tsx @@ -1,4 +1,5 @@ import React, { forwardRef } from 'react'; + import type { InputNumberProps } from '..'; import InputNumber from '..'; import focusTest from '../../../tests/shared/focusTest'; diff --git a/components/input-number/demo/addon.tsx b/components/input-number/demo/addon.tsx index 9e87d4399c..4378eca30b 100644 --- a/components/input-number/demo/addon.tsx +++ b/components/input-number/demo/addon.tsx @@ -1,5 +1,5 @@ -import { SettingOutlined } from '@ant-design/icons'; import React from 'react'; +import { SettingOutlined } from '@ant-design/icons'; import { Cascader, InputNumber, Select, Space } from 'antd'; const { Option } = Select; diff --git a/components/input/OTP/OTPInput.tsx b/components/input/OTP/OTPInput.tsx index de15ad4ac1..a89d730dee 100644 --- a/components/input/OTP/OTPInput.tsx +++ b/components/input/OTP/OTPInput.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import raf from 'rc-util/lib/raf'; -import Input, { type InputProps, type InputRef } from '../Input'; +import Input from '../Input'; +import type { InputProps, InputRef } from '../Input'; export interface OTPInputProps extends Omit { index: number; diff --git a/components/input/OTP/index.tsx b/components/input/OTP/index.tsx index 89cb383e89..d268431380 100644 --- a/components/input/OTP/index.tsx +++ b/components/input/OTP/index.tsx @@ -3,16 +3,18 @@ import classNames from 'classnames'; import { useEvent } from 'rc-util'; import pickAttrs from 'rc-util/lib/pickAttrs'; -import { getMergedStatus, type InputStatus } from '../../_util/statusUtils'; +import { getMergedStatus } from '../../_util/statusUtils'; +import type { InputStatus } from '../../_util/statusUtils'; import { ConfigContext } from '../../config-provider'; import useCSSVarCls from '../../config-provider/hooks/useCSSVarCls'; import useSize from '../../config-provider/hooks/useSize'; -import { type SizeType } from '../../config-provider/SizeContext'; +import type { SizeType } from '../../config-provider/SizeContext'; import { FormItemInputContext } from '../../form/context'; import type { Variant } from '../../form/hooks/useVariants'; -import { type InputRef } from '../Input'; +import type { InputRef } from '../Input'; import useStyle from '../style/otp'; -import OTPInput, { type OTPInputProps } from './OTPInput'; +import OTPInput from './OTPInput'; +import type { OTPInputProps } from './OTPInput'; export interface OTPRef { focus: VoidFunction; diff --git a/components/input/__tests__/Password.test.tsx b/components/input/__tests__/Password.test.tsx index a40cb60fbb..57c45d5fae 100644 --- a/components/input/__tests__/Password.test.tsx +++ b/components/input/__tests__/Password.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { InputRef } from '..'; import Input from '..'; import focusTest from '../../../tests/shared/focusTest'; diff --git a/components/input/__tests__/Search.test.tsx b/components/input/__tests__/Search.test.tsx index b81e1a7cb9..ed118e3cb9 100644 --- a/components/input/__tests__/Search.test.tsx +++ b/components/input/__tests__/Search.test.tsx @@ -1,5 +1,6 @@ -import { fireEvent, render } from '@testing-library/react'; import React from 'react'; +import { fireEvent, render } from '@testing-library/react'; + import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/input/__tests__/demo.test.tsx b/components/input/__tests__/demo.test.tsx index 99446ad6fe..51255fcc02 100644 --- a/components/input/__tests__/demo.test.tsx +++ b/components/input/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('input', { diff --git a/components/input/__tests__/focus.test.tsx b/components/input/__tests__/focus.test.tsx index 825095d9a0..e488641595 100644 --- a/components/input/__tests__/focus.test.tsx +++ b/components/input/__tests__/focus.test.tsx @@ -1,5 +1,6 @@ -import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; import React from 'react'; +import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; + import Input from '..'; import { fireEvent, render } from '../../../tests/utils'; import type { InputRef } from '../Input'; diff --git a/components/input/__tests__/index.test.tsx b/components/input/__tests__/index.test.tsx index faa9663390..c66efb51f2 100644 --- a/components/input/__tests__/index.test.tsx +++ b/components/input/__tests__/index.test.tsx @@ -1,12 +1,13 @@ import React, { useState } from 'react'; import { createPortal } from 'react-dom'; -import { fireEvent, render } from '../../../tests/utils'; + // eslint-disable-next-line import/no-unresolved import type { InputProps, InputRef } from '..'; import Input from '..'; +import { resetWarned } from '../../_util/warning'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import { resetWarned } from '../../_util/warning'; +import { fireEvent, render } from '../../../tests/utils'; import Form from '../../form'; import { triggerFocus } from '../Input'; diff --git a/components/input/__tests__/type.test.tsx b/components/input/__tests__/type.test.tsx index 8f509b0a25..464f5c3b7a 100644 --- a/components/input/__tests__/type.test.tsx +++ b/components/input/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Input from '..'; import { render } from '../../../tests/utils'; import type { InputProps } from '../Input'; diff --git a/components/input/demo/compact-style.tsx b/components/input/demo/compact-style.tsx index 9a6de22a9e..0858810724 100644 --- a/components/input/demo/compact-style.tsx +++ b/components/input/demo/compact-style.tsx @@ -1,5 +1,5 @@ -import { SearchOutlined } from '@ant-design/icons'; import React from 'react'; +import { SearchOutlined } from '@ant-design/icons'; import { Button, Input, Select, Space } from 'antd'; const { Search } = Input; diff --git a/components/input/demo/debug-addon.tsx b/components/input/demo/debug-addon.tsx index 15927e37b9..1cd6c07c78 100644 --- a/components/input/demo/debug-addon.tsx +++ b/components/input/demo/debug-addon.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { SettingOutlined } from '@ant-design/icons'; -import { Input, Space, Button } from 'antd'; +import { Button, Input, Space } from 'antd'; const App: React.FC = () => ( diff --git a/components/input/demo/focus.tsx b/components/input/demo/focus.tsx index 20fe14114b..df2c64e55c 100644 --- a/components/input/demo/focus.tsx +++ b/components/input/demo/focus.tsx @@ -1,6 +1,5 @@ import React, { useRef, useState } from 'react'; import type { InputRef } from 'antd'; - import { Button, Input, Space, Switch } from 'antd'; const App: React.FC = () => { diff --git a/components/input/demo/group.tsx b/components/input/demo/group.tsx index bc646f316d..e25482200c 100644 --- a/components/input/demo/group.tsx +++ b/components/input/demo/group.tsx @@ -1,5 +1,5 @@ -import { CopyOutlined } from '@ant-design/icons'; import React from 'react'; +import { CopyOutlined } from '@ant-design/icons'; import { AutoComplete, Button, diff --git a/components/input/demo/otp.tsx b/components/input/demo/otp.tsx index 2da51facc5..9b82e3d24d 100644 --- a/components/input/demo/otp.tsx +++ b/components/input/demo/otp.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Input, Space, Typography, type GetProp } from 'antd'; +import type { GetProp } from 'antd'; +import { Input, Space, Typography } from 'antd'; const { Title } = Typography; diff --git a/components/input/hooks/useRemovePasswordTimeout.ts b/components/input/hooks/useRemovePasswordTimeout.ts index 94bf78a827..c04347ad09 100644 --- a/components/input/hooks/useRemovePasswordTimeout.ts +++ b/components/input/hooks/useRemovePasswordTimeout.ts @@ -1,4 +1,5 @@ import { useEffect, useRef } from 'react'; + import type { InputRef } from '../Input'; export default function useRemovePasswordTimeout( diff --git a/components/input/style/variants.ts b/components/input/style/variants.ts index 39a2a3bda5..bea6da6894 100644 --- a/components/input/style/variants.ts +++ b/components/input/style/variants.ts @@ -1,7 +1,8 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; -import type { InputToken } from './token'; + import { mergeToken } from '../../theme/internal'; +import type { InputToken } from './token'; export const genHoverStyle = (token: InputToken): CSSObject => ({ borderColor: token.hoverBorderColor, diff --git a/components/input/utils.ts b/components/input/utils.ts index 7739da0a76..d3d662d8dc 100644 --- a/components/input/utils.ts +++ b/components/input/utils.ts @@ -1,4 +1,5 @@ import type { ReactNode } from 'react'; + import type { InputProps } from './Input'; // eslint-disable-next-line import/prefer-default-export diff --git a/components/layout/__tests__/dynamic-breakpoint.test.tsx b/components/layout/__tests__/dynamic-breakpoint.test.tsx index ee7954d069..302c3636bf 100644 --- a/components/layout/__tests__/dynamic-breakpoint.test.tsx +++ b/components/layout/__tests__/dynamic-breakpoint.test.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; + import { fireEvent, render } from '../../../tests/utils'; import Sider from '../Sider'; diff --git a/components/layout/__tests__/token.test.tsx b/components/layout/__tests__/token.test.tsx index bce722042e..195fb13c98 100644 --- a/components/layout/__tests__/token.test.tsx +++ b/components/layout/__tests__/token.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Layout from '..'; import { render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/layout/__tests__/warning.test.tsx b/components/layout/__tests__/warning.test.tsx index 44dc66b125..a31b04e687 100644 --- a/components/layout/__tests__/warning.test.tsx +++ b/components/layout/__tests__/warning.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Layout from '..'; import { render } from '../../../tests/utils'; diff --git a/components/layout/demo/basic.tsx b/components/layout/demo/basic.tsx index 8a5a4b0fd9..ad38c34e10 100644 --- a/components/layout/demo/basic.tsx +++ b/components/layout/demo/basic.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Layout, Flex } from 'antd'; +import { Flex, Layout } from 'antd'; const { Header, Footer, Sider, Content } = Layout; diff --git a/components/layout/demo/custom-trigger-debug.tsx b/components/layout/demo/custom-trigger-debug.tsx index e273f462db..15bcca77b9 100644 --- a/components/layout/demo/custom-trigger-debug.tsx +++ b/components/layout/demo/custom-trigger-debug.tsx @@ -9,7 +9,7 @@ import { UserOutlined, } from '@ant-design/icons'; import type { MenuProps } from 'antd'; -import { Layout, Menu, Button, theme } from 'antd'; +import { Button, Layout, Menu, theme } from 'antd'; const { Header, Sider, Content } = Layout; diff --git a/components/layout/demo/custom-trigger.tsx b/components/layout/demo/custom-trigger.tsx index ec149f974b..d786a3e832 100644 --- a/components/layout/demo/custom-trigger.tsx +++ b/components/layout/demo/custom-trigger.tsx @@ -6,7 +6,7 @@ import { UserOutlined, VideoCameraOutlined, } from '@ant-design/icons'; -import { Layout, Menu, Button, theme } from 'antd'; +import { Button, Layout, Menu, theme } from 'antd'; const { Header, Sider, Content } = Layout; diff --git a/components/layout/style/index.ts b/components/layout/style/index.ts index ec05b61709..73b39b78fa 100644 --- a/components/layout/style/index.ts +++ b/components/layout/style/index.ts @@ -1,5 +1,7 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; import type { CSSProperties } from 'react'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks } from '../../theme/internal'; import genLayoutLightStyle from './light'; diff --git a/components/layout/style/light.ts b/components/layout/style/light.ts index da2aa7435f..c4c52ebe34 100644 --- a/components/layout/style/light.ts +++ b/components/layout/style/light.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { LayoutToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/list/__tests__/Item.test.tsx b/components/list/__tests__/Item.test.tsx index 3c5bcdbdaf..5426206ebb 100644 --- a/components/list/__tests__/Item.test.tsx +++ b/components/list/__tests__/Item.test.tsx @@ -1,4 +1,5 @@ import React, { useEffect } from 'react'; + import List from '..'; import { pureRender, render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/list/__tests__/empty.test.tsx b/components/list/__tests__/empty.test.tsx index 333d4e6183..f0eeff3548 100644 --- a/components/list/__tests__/empty.test.tsx +++ b/components/list/__tests__/empty.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import List from '..'; import { render } from '../../../tests/utils'; diff --git a/components/list/__tests__/index.test.tsx b/components/list/__tests__/index.test.tsx index bc30f29041..aa6980c713 100644 --- a/components/list/__tests__/index.test.tsx +++ b/components/list/__tests__/index.test.tsx @@ -1,10 +1,11 @@ import React from 'react'; + import type { ListProps } from '..'; import List from '..'; -import ConfigProvider from '../../config-provider'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; describe('List', () => { mountTest(List); diff --git a/components/list/__tests__/loading.test.tsx b/components/list/__tests__/loading.test.tsx index 821fc5d4c8..85b7b37409 100644 --- a/components/list/__tests__/loading.test.tsx +++ b/components/list/__tests__/loading.test.tsx @@ -1,8 +1,8 @@ -import { LoadingOutlined } from '@ant-design/icons'; import React from 'react'; -import { render } from '../../../tests/utils'; +import { LoadingOutlined } from '@ant-design/icons'; import List from '..'; +import { render } from '../../../tests/utils'; describe('List', () => { it('renders empty loading', () => { diff --git a/components/list/__tests__/pagination.test.tsx b/components/list/__tests__/pagination.test.tsx index 7e07004339..e3873c3255 100644 --- a/components/list/__tests__/pagination.test.tsx +++ b/components/list/__tests__/pagination.test.tsx @@ -1,8 +1,9 @@ import React from 'react'; + import type { ListProps } from '..'; import List from '..'; -import { fireEvent, render } from '../../../tests/utils'; import { noop } from '../../_util/warning'; +import { fireEvent, render } from '../../../tests/utils'; interface DataSourceItem { name: string; diff --git a/components/list/context.ts b/components/list/context.ts index 8c0f694363..28ff78dd2e 100644 --- a/components/list/context.ts +++ b/components/list/context.ts @@ -1,4 +1,5 @@ import React from 'react'; + import type { ListGridType } from '.'; export interface ListConsumerProps { diff --git a/components/list/demo/infinite-load.tsx b/components/list/demo/infinite-load.tsx index 1b49e037da..8b74812a32 100644 --- a/components/list/demo/infinite-load.tsx +++ b/components/list/demo/infinite-load.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; -import InfiniteScroll from 'react-infinite-scroll-component'; import { Avatar, Divider, List, Skeleton } from 'antd'; +import InfiniteScroll from 'react-infinite-scroll-component'; interface DataType { gender: string; diff --git a/components/list/demo/vertical.tsx b/components/list/demo/vertical.tsx index 967334db6c..78727adb33 100644 --- a/components/list/demo/vertical.tsx +++ b/components/list/demo/vertical.tsx @@ -1,5 +1,5 @@ -import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; import React from 'react'; +import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; import { Avatar, List, Space } from 'antd'; const data = Array.from({ length: 23 }).map((_, i) => ({ diff --git a/components/list/index.tsx b/components/list/index.tsx index 35bedd9dc4..1a781f9831 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,10 +1,12 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import extendsObject from '../_util/extendsObject'; import type { Breakpoint } from '../_util/responsiveObserver'; import { responsiveArray } from '../_util/responsiveObserver'; import { ConfigContext } from '../config-provider'; import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import useSize from '../config-provider/hooks/useSize'; import { Row } from '../grid'; import type { RowProps } from '../grid'; import useBreakpoint from '../grid/hooks/useBreakpoint'; @@ -12,10 +14,9 @@ import type { PaginationConfig } from '../pagination'; import Pagination from '../pagination'; import type { SpinProps } from '../spin'; import Spin from '../spin'; -import Item from './Item'; import { ListContext } from './context'; +import Item from './Item'; import useStyle from './style'; -import useSize from '../config-provider/hooks/useSize'; export type { ListItemMetaProps, ListItemProps } from './Item'; export type { ListConsumerProps } from './context'; diff --git a/components/list/style/index.ts b/components/list/style/index.ts index 32e7bda084..573ad0c0f7 100644 --- a/components/list/style/index.ts +++ b/components/list/style/index.ts @@ -1,5 +1,7 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; import type { CSSProperties } from 'react'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/locale/__tests__/cached-context.test.tsx b/components/locale/__tests__/cached-context.test.tsx index c9a9406e66..ab264148ad 100644 --- a/components/locale/__tests__/cached-context.test.tsx +++ b/components/locale/__tests__/cached-context.test.tsx @@ -1,6 +1,7 @@ import React, { memo, useContext } from 'react'; -import { fireEvent, pureRender } from '../../../tests/utils'; + import LocaleProvider from '..'; +import { fireEvent, pureRender } from '../../../tests/utils'; import LocaleContext from '../context'; let innerCount = 0; diff --git a/components/locale/__tests__/config.test.tsx b/components/locale/__tests__/config.test.tsx index 22203b0fd1..0c26ec0641 100644 --- a/components/locale/__tests__/config.test.tsx +++ b/components/locale/__tests__/config.test.tsx @@ -1,4 +1,5 @@ import React, { useEffect } from 'react'; + import { Modal } from '../..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/locale/az_AZ.ts b/components/locale/az_AZ.ts index a2e9dcf41c..f624730865 100644 --- a/components/locale/az_AZ.ts +++ b/components/locale/az_AZ.ts @@ -1,8 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/az_AZ'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/az_AZ'; import DatePicker from '../date-picker/locale/az_AZ'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/az_AZ'; const typeTemplate = '${label}Hökmlü deyil${type}'; diff --git a/components/locale/bg_BG.ts b/components/locale/bg_BG.ts index 060479061e..03e6e89c3e 100644 --- a/components/locale/bg_BG.ts +++ b/components/locale/bg_BG.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/bg_BG'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/bg_BG'; import DatePicker from '../date-picker/locale/bg_BG'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/bg_BG'; const typeTemplate = '${label} не е валиден ${type}'; diff --git a/components/locale/context.ts b/components/locale/context.ts index 6ce304f77f..71f3104f67 100644 --- a/components/locale/context.ts +++ b/components/locale/context.ts @@ -1,4 +1,5 @@ import { createContext } from 'react'; + import type { Locale } from '.'; export type LocaleContextProps = Locale & { exist?: boolean }; diff --git a/components/locale/da_DK.ts b/components/locale/da_DK.ts index b25e906d02..ab34fd1e9f 100644 --- a/components/locale/da_DK.ts +++ b/components/locale/da_DK.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/da_DK'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/da_DK'; import DatePicker from '../date-picker/locale/da_DK'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/da_DK'; const typeTemplate = '${label} er ikke en gyldig ${type}'; diff --git a/components/locale/el_GR.ts b/components/locale/el_GR.ts index 97a489a416..e96271c726 100644 --- a/components/locale/el_GR.ts +++ b/components/locale/el_GR.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/el_GR'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/el_GR'; import DatePicker from '../date-picker/locale/el_GR'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/el_GR'; const localeValues: Locale = { diff --git a/components/locale/fi_FI.ts b/components/locale/fi_FI.ts index 375f8a2ec0..4d1e333b37 100644 --- a/components/locale/fi_FI.ts +++ b/components/locale/fi_FI.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/fi_FI'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/fi_FI'; import DatePicker from '../date-picker/locale/fi_FI'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/fi_FI'; const localeValues: Locale = { diff --git a/components/locale/hu_HU.ts b/components/locale/hu_HU.ts index 4570259e70..315d4b95ed 100644 --- a/components/locale/hu_HU.ts +++ b/components/locale/hu_HU.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/hu_HU'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/hu_HU'; import DatePicker from '../date-picker/locale/hu_HU'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/hu_HU'; const localeValues: Locale = { diff --git a/components/locale/id_ID.ts b/components/locale/id_ID.ts index 4b7e718909..6d6a5a04d4 100644 --- a/components/locale/id_ID.ts +++ b/components/locale/id_ID.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/id_ID'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/id_ID'; import DatePicker from '../date-picker/locale/id_ID'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/id_ID'; const localeValues: Locale = { diff --git a/components/locale/is_IS.ts b/components/locale/is_IS.ts index 2d3c1432c1..3cab6715af 100644 --- a/components/locale/is_IS.ts +++ b/components/locale/is_IS.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/is_IS'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/is_IS'; import DatePicker from '../date-picker/locale/is_IS'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/is_IS'; const typeTemplate = '${label} er ekki gilt ${type}'; diff --git a/components/locale/ja_JP.ts b/components/locale/ja_JP.ts index 264b79ec17..c2432fec25 100644 --- a/components/locale/ja_JP.ts +++ b/components/locale/ja_JP.ts @@ -1,8 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ja_JP'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/ja_JP'; import DatePicker from '../date-picker/locale/ja_JP'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/ja_JP'; const typeTemplate = '${label}は有効な${type}ではありません'; diff --git a/components/locale/km_KH.ts b/components/locale/km_KH.ts index fb92c89a43..3b7643dddd 100644 --- a/components/locale/km_KH.ts +++ b/components/locale/km_KH.ts @@ -1,8 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/km_KH'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/km_KH'; import DatePicker from '../date-picker/locale/km_KH'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/km_KH'; const typeTemplate = '${label} is not a valid ${type}'; diff --git a/components/locale/kmr_IQ.ts b/components/locale/kmr_IQ.ts index d92b74bda2..ce7d467884 100644 --- a/components/locale/kmr_IQ.ts +++ b/components/locale/kmr_IQ.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kmr_IQ'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/kmr_IQ'; import DatePicker from '../date-picker/locale/kmr_IQ'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/kmr_IQ'; const localeValues: Locale = { diff --git a/components/locale/kn_IN.ts b/components/locale/kn_IN.ts index df84c67fe1..a397015d9a 100644 --- a/components/locale/kn_IN.ts +++ b/components/locale/kn_IN.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kn_IN'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/kn_IN'; import DatePicker from '../date-picker/locale/kn_IN'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/kn_IN'; const localeValues: Locale = { diff --git a/components/locale/ku_IQ.ts b/components/locale/ku_IQ.ts index 5605b6db26..aada708f84 100755 --- a/components/locale/ku_IQ.ts +++ b/components/locale/ku_IQ.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kmr_IQ'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/kmr_IQ'; import DatePicker from '../date-picker/locale/kmr_IQ'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/kmr_IQ'; // please use antd/locale/kmr_IQ instead diff --git a/components/locale/lv_LV.ts b/components/locale/lv_LV.ts index 7ce3b91a50..4d0d3caeb2 100644 --- a/components/locale/lv_LV.ts +++ b/components/locale/lv_LV.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/lv_LV'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/lv_LV'; import DatePicker from '../date-picker/locale/lv_LV'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/lv_LV'; const localeValues: Locale = { diff --git a/components/locale/mn_MN.ts b/components/locale/mn_MN.ts index dab405632d..869528c6f9 100644 --- a/components/locale/mn_MN.ts +++ b/components/locale/mn_MN.ts @@ -1,4 +1,5 @@ import Pagination from 'rc-pagination/lib/locale/mn_MN'; + import type { Locale } from '.'; import Calendar from '../calendar/locale/mn_MN'; import DatePicker from '../date-picker/locale/mn_MN'; diff --git a/components/locale/ne_NP.ts b/components/locale/ne_NP.ts index ae1377d308..efca60be98 100644 --- a/components/locale/ne_NP.ts +++ b/components/locale/ne_NP.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/en_US'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/en_US'; import DatePicker from '../date-picker/locale/en_US'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/en_US'; const localeValues: Locale = { diff --git a/components/locale/sl_SI.ts b/components/locale/sl_SI.ts index 8fb10e6a1b..e2423a856c 100644 --- a/components/locale/sl_SI.ts +++ b/components/locale/sl_SI.ts @@ -1,7 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/sl_SI'; + +import type { Locale } from '.'; import Calendar from '../calendar/locale/sl_SI'; import DatePicker from '../date-picker/locale/sl_SI'; -import type { Locale } from '.'; import TimePicker from '../time-picker/locale/sl_SI'; const localeValues: Locale = { diff --git a/components/locale/useLocale.ts b/components/locale/useLocale.ts index 69be9bc409..6203f13608 100644 --- a/components/locale/useLocale.ts +++ b/components/locale/useLocale.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { Locale } from '.'; import type { LocaleContextProps } from './context'; import LocaleContext from './context'; diff --git a/components/mentions/__tests__/demo.test.tsx b/components/mentions/__tests__/demo.test.tsx index 1d7e528071..c9ac06f55b 100644 --- a/components/mentions/__tests__/demo.test.tsx +++ b/components/mentions/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; import { fireEvent } from '../../../tests/utils'; diff --git a/components/mentions/__tests__/index.test.tsx b/components/mentions/__tests__/index.test.tsx index c3958e6dfa..5fe5aea5db 100644 --- a/components/mentions/__tests__/index.test.tsx +++ b/components/mentions/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Mentions, { Option } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/mentions/demo/async.tsx b/components/mentions/demo/async.tsx index 8ebabc31bd..d62b26852b 100644 --- a/components/mentions/demo/async.tsx +++ b/components/mentions/demo/async.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useRef, useState } from 'react'; -import debounce from 'lodash/debounce'; import { Mentions } from 'antd'; +import debounce from 'lodash/debounce'; const App: React.FC = () => { const [loading, setLoading] = useState(false); diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 6277490eaf..1740ddc43b 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -9,19 +9,19 @@ import type { } from 'rc-mentions/lib/Mentions'; import { composeRef } from 'rc-util/lib/ref'; +import getAllowClear from '../_util/getAllowClear'; import genPurePanel from '../_util/PurePanel'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; import { devUseWarning } from '../_util/warning'; import { ConfigContext } from '../config-provider'; import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty'; -import { FormItemInputContext } from '../form/context'; -import Spin from '../spin'; -import useStyle from './style'; import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; +import { FormItemInputContext } from '../form/context'; import type { Variant } from '../form/hooks/useVariants'; import useVariant from '../form/hooks/useVariants'; -import getAllowClear from '../_util/getAllowClear'; +import Spin from '../spin'; +import useStyle from './style'; export const { Option } = RcMentions; diff --git a/components/mentions/style/index.ts b/components/mentions/style/index.ts index 4f5141668f..919c7e091b 100644 --- a/components/mentions/style/index.ts +++ b/components/mentions/style/index.ts @@ -1,20 +1,21 @@ -import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; +import { unit } from '@ant-design/cssinjs'; + import { genBasicInputStyle, genPlaceholderStyle, initComponentToken, initInputToken, } from '../../input/style'; -import { resetComponent, textEllipsis } from '../../style'; -import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; -import { genStyleHooks, mergeToken } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; +import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; import { genBorderlessStyle, genDisabledStyle, genFilledStyle, genOutlinedStyle, } from '../../input/style/variants'; +import { resetComponent, textEllipsis } from '../../style'; +import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; +import { genStyleHooks, mergeToken } from '../../theme/internal'; export interface ComponentToken extends SharedComponentToken { /** diff --git a/components/menu/MenuContext.tsx b/components/menu/MenuContext.tsx index 5719efe131..a77a0951dc 100644 --- a/components/menu/MenuContext.tsx +++ b/components/menu/MenuContext.tsx @@ -1,4 +1,5 @@ import { createContext } from 'react'; + import type { DirectionType } from '../config-provider'; export type MenuTheme = 'light' | 'dark'; diff --git a/components/menu/MenuDivider.tsx b/components/menu/MenuDivider.tsx index 1441481bec..2f0b820072 100644 --- a/components/menu/MenuDivider.tsx +++ b/components/menu/MenuDivider.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import classNames from 'classnames'; import { Divider } from 'rc-menu'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; export interface MenuDividerProps extends React.HTMLAttributes { diff --git a/components/menu/__tests__/cached-context.test.tsx b/components/menu/__tests__/cached-context.test.tsx index 99f49fb324..cba2a31589 100644 --- a/components/menu/__tests__/cached-context.test.tsx +++ b/components/menu/__tests__/cached-context.test.tsx @@ -1,7 +1,8 @@ import React, { memo, useContext } from 'react'; + +import { fireEvent, pureRender } from '../../../tests/utils'; import Menu from '../index'; import MenuContext from '../MenuContext'; -import { fireEvent, pureRender } from '../../../tests/utils'; let innerCount = 0; let outerCount = 0; diff --git a/components/menu/__tests__/demo.test.tsx b/components/menu/__tests__/demo.test.tsx index 8edf31440a..3bec160d26 100644 --- a/components/menu/__tests__/demo.test.tsx +++ b/components/menu/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('menu', { testRootProps: false }); diff --git a/components/menu/__tests__/type.test.tsx b/components/menu/__tests__/type.test.tsx index 631e99d00e..c261216a3f 100644 --- a/components/menu/__tests__/type.test.tsx +++ b/components/menu/__tests__/type.test.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import Menu, { type MenuItemProps } from '..'; + +import Menu from '..'; +import type { MenuItemProps } from '..'; import type { MenuItemType } from '../hooks/useItems'; describe('Menu.typescript', () => { diff --git a/components/menu/demo/submenu-theme.tsx b/components/menu/demo/submenu-theme.tsx index c42c3afcd2..1face87374 100644 --- a/components/menu/demo/submenu-theme.tsx +++ b/components/menu/demo/submenu-theme.tsx @@ -1,5 +1,5 @@ -import { MailOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { MailOutlined } from '@ant-design/icons'; import type { MenuProps, MenuTheme } from 'antd'; import { Menu, Switch } from 'antd'; diff --git a/components/menu/hooks/useItems.tsx b/components/menu/hooks/useItems.tsx index 33ab721d8c..72b199a6e7 100644 --- a/components/menu/hooks/useItems.tsx +++ b/components/menu/hooks/useItems.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import { ItemGroup } from 'rc-menu'; import type { MenuDividerType as RcMenuDividerType, @@ -5,7 +6,7 @@ import type { MenuItemType as RcMenuItemType, SubMenuType as RcSubMenuType, } from 'rc-menu/lib/interface'; -import * as React from 'react'; + import MenuDivider from '../MenuDivider'; import MenuItem from '../MenuItem'; import SubMenu from '../SubMenu'; diff --git a/components/menu/index.tsx b/components/menu/index.tsx index 610badfb16..758f5d8be7 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -9,8 +9,10 @@ import type { MenuProps } from './menu'; import InternalMenu from './menu'; import type { MenuTheme } from './MenuContext'; import MenuDivider from './MenuDivider'; -import Item, { type MenuItemProps } from './MenuItem'; -import SubMenu, { type SubMenuProps } from './SubMenu'; +import Item from './MenuItem'; +import type { MenuItemProps } from './MenuItem'; +import SubMenu from './SubMenu'; +import type { SubMenuProps } from './SubMenu'; export type { MenuItemGroupProps } from 'rc-menu'; export type { MenuDividerProps } from './MenuDivider'; diff --git a/components/menu/style/horizontal.ts b/components/menu/style/horizontal.ts index f483170525..28a97e0d18 100644 --- a/components/menu/style/horizontal.ts +++ b/components/menu/style/horizontal.ts @@ -1,4 +1,5 @@ import { unit } from '@ant-design/cssinjs'; + import type { MenuToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/menu/style/rtl.ts b/components/menu/style/rtl.ts index cec639304a..a4c33c9d5e 100644 --- a/components/menu/style/rtl.ts +++ b/components/menu/style/rtl.ts @@ -1,7 +1,8 @@ +import { unit } from '@ant-design/cssinjs'; import type { CssUtil } from 'antd-style'; + import type { MenuToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; const getRTLStyle: GenerateStyle = ({ componentCls, diff --git a/components/menu/style/vertical.ts b/components/menu/style/vertical.ts index f74814aa46..5e5018de63 100644 --- a/components/menu/style/vertical.ts +++ b/components/menu/style/vertical.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { MenuToken } from '.'; import { textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/message/PurePanel.tsx b/components/message/PurePanel.tsx index 9213b4c216..481374487d 100644 --- a/components/message/PurePanel.tsx +++ b/components/message/PurePanel.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; @@ -6,11 +7,11 @@ import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import { Notice } from 'rc-notification'; import type { NoticeProps } from 'rc-notification/lib/Notice'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import type { NoticeType } from './interface'; import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; export const TypeIcon = { info: , diff --git a/components/message/__tests__/hooks.test.tsx b/components/message/__tests__/hooks.test.tsx index d5ba98c426..6b07b29eb9 100644 --- a/components/message/__tests__/hooks.test.tsx +++ b/components/message/__tests__/hooks.test.tsx @@ -1,7 +1,8 @@ /* eslint-disable jsx-a11y/control-has-associated-label */ import React, { useEffect } from 'react'; +import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs'; import { act } from 'react-dom/test-utils'; -import { StyleProvider, createCache, extractStyle } from '@ant-design/cssinjs'; + import message from '..'; import { fireEvent, render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/message/__tests__/index.test.tsx b/components/message/__tests__/index.test.tsx index 58b91a3e1c..317f86cb12 100644 --- a/components/message/__tests__/index.test.tsx +++ b/components/message/__tests__/index.test.tsx @@ -1,5 +1,6 @@ -import { SmileOutlined } from '@ant-design/icons'; import React from 'react'; +import { SmileOutlined } from '@ant-design/icons'; + import message, { actWrapper } from '..'; import { act, fireEvent, waitFakeTimer } from '../../../tests/utils'; import { awaitPromise, triggerMotionEnd } from './util'; diff --git a/components/message/__tests__/static-warning.test.tsx b/components/message/__tests__/static-warning.test.tsx index 007b1e4aff..f9f7ebfd54 100644 --- a/components/message/__tests__/static-warning.test.tsx +++ b/components/message/__tests__/static-warning.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import message, { actWrapper } from '..'; import { act, render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/modal/PurePanel.tsx b/components/modal/PurePanel.tsx index 9261be0904..c259070c8a 100644 --- a/components/modal/PurePanel.tsx +++ b/components/modal/PurePanel.tsx @@ -7,11 +7,11 @@ import type { PanelProps } from 'rc-dialog/lib/Dialog/Content/Panel'; import { withPureRenderTheme } from '../_util/PurePanel'; import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import { ConfirmContent } from './ConfirmDialog'; import type { ModalFuncProps } from './interface'; import { Footer, renderCloseIcon } from './shared'; import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; export interface PurePanelProps extends Omit, diff --git a/components/modal/__tests__/demo.test.tsx b/components/modal/__tests__/demo.test.tsx index e02e3b6d82..498c4c5011 100644 --- a/components/modal/__tests__/demo.test.tsx +++ b/components/modal/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('modal', { diff --git a/components/modal/__tests__/static-warning.test.tsx b/components/modal/__tests__/static-warning.test.tsx index 319044d20e..77119e78cb 100644 --- a/components/modal/__tests__/static-warning.test.tsx +++ b/components/modal/__tests__/static-warning.test.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; + import Modal from '..'; -import { render, waitFakeTimer } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; +import { render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('Modal.confirm warning', () => { diff --git a/components/modal/__tests__/type.test.tsx b/components/modal/__tests__/type.test.tsx index 8276ec7cef..661923efae 100644 --- a/components/modal/__tests__/type.test.tsx +++ b/components/modal/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Modal from '..'; describe('Modal.typescript', () => { diff --git a/components/modal/demo/_semantic.tsx b/components/modal/demo/_semantic.tsx index a4d94b7524..2d033b9366 100644 --- a/components/modal/demo/_semantic.tsx +++ b/components/modal/demo/_semantic.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { Modal, type ModalProps } from 'antd'; +import type { ModalProps } from 'antd'; +import { Modal } from 'antd'; import SemanticPreview from '../../../.dumi/components/SemanticPreview'; import useLocale from '../../../.dumi/hooks/useLocale'; diff --git a/components/modal/demo/dark.tsx b/components/modal/demo/dark.tsx index ea21be6764..922c7fb861 100644 --- a/components/modal/demo/dark.tsx +++ b/components/modal/demo/dark.tsx @@ -1,28 +1,28 @@ // @ts-nocheck import React, { useState } from 'react'; -import difference from 'lodash/difference'; -import { DownOutlined, ClockCircleOutlined } from '@ant-design/icons'; -import dayjs from 'dayjs'; -import customParseFormat from 'dayjs/plugin/customParseFormat'; +import { ClockCircleOutlined, DownOutlined } from '@ant-design/icons'; import { - Modal, - DatePicker, - Slider, - Tree, - Badge, - Collapse, - Timeline, - Tabs, Anchor, - Table, - Card, + Badge, Button, Calendar, - Transfer, - Switch, - Typography, + Card, + Collapse, + DatePicker, Dropdown, + Modal, + Slider, + Switch, + Table, + Tabs, + Timeline, + Transfer, + Tree, + Typography, } from 'antd'; +import dayjs from 'dayjs'; +import customParseFormat from 'dayjs/plugin/customParseFormat'; +import difference from 'lodash/difference'; dayjs.extend(customParseFormat); diff --git a/components/modal/demo/locale.tsx b/components/modal/demo/locale.tsx index fe1adc9ecc..0c4d03c95c 100644 --- a/components/modal/demo/locale.tsx +++ b/components/modal/demo/locale.tsx @@ -1,5 +1,5 @@ -import { ExclamationCircleOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { ExclamationCircleOutlined } from '@ant-design/icons'; import { Button, Modal, Space } from 'antd'; const LocalizedModal = () => { diff --git a/components/modal/demo/modal-render.tsx b/components/modal/demo/modal-render.tsx index a19cf6b2e2..1ea4d01ade 100644 --- a/components/modal/demo/modal-render.tsx +++ b/components/modal/demo/modal-render.tsx @@ -1,7 +1,7 @@ import React, { useRef, useState } from 'react'; +import { Button, Modal } from 'antd'; import type { DraggableData, DraggableEvent } from 'react-draggable'; import Draggable from 'react-draggable'; -import { Button, Modal } from 'antd'; const App: React.FC = () => { const [open, setOpen] = useState(false); diff --git a/components/modal/interface.ts b/components/modal/interface.ts index 1b83732c2c..576e2e9acd 100644 --- a/components/modal/interface.ts +++ b/components/modal/interface.ts @@ -1,9 +1,9 @@ import type { FC } from 'react'; import type { DialogProps } from 'rc-dialog'; +import type { ClosableType } from '../_util/hooks/useClosable'; import type { ButtonProps, LegacyButtonType } from '../button/button'; import type { DirectionType } from '../config-provider'; -import type { ClosableType } from '../_util/hooks/useClosable'; export type ModalFooterRender = ( originNode: React.ReactNode, diff --git a/components/modal/style/confirm.ts b/components/modal/style/confirm.ts index 5e481c700f..9c73228797 100644 --- a/components/modal/style/confirm.ts +++ b/components/modal/style/confirm.ts @@ -1,8 +1,11 @@ // Style as confirm component import { unit } from '@ant-design/cssinjs'; -import { prepareComponentToken, prepareToken, type ModalToken } from '.'; + +import { prepareComponentToken, prepareToken } from '.'; +import type { ModalToken } from '.'; import { clearFix } from '../../style'; -import { genSubStyleComponent, type GenerateStyle } from '../../theme/internal'; +import { genSubStyleComponent } from '../../theme/internal'; +import type { GenerateStyle } from '../../theme/internal'; // ============================= Confirm ============================== diff --git a/components/modal/style/index.ts b/components/modal/style/index.ts index 45f360e329..9abc262b75 100644 --- a/components/modal/style/index.ts +++ b/components/modal/style/index.ts @@ -1,4 +1,5 @@ import type React from 'react'; +import { unit } from '@ant-design/cssinjs'; import { genFocusStyle, resetComponent } from '../../style'; import { initFadeMotion, initZoomMotion } from '../../style/motion'; @@ -6,7 +7,6 @@ import type { GlobalToken } from '../../theme'; import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; import type { GenStyleFn, TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; -import { unit } from '@ant-design/cssinjs'; /** Component only token. Which will handle additional calculation of alias token */ export interface ComponentToken { diff --git a/components/modal/useModal/HookModal.tsx b/components/modal/useModal/HookModal.tsx index 58384c0253..829d81368b 100644 --- a/components/modal/useModal/HookModal.tsx +++ b/components/modal/useModal/HookModal.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import { ConfigContext } from '../../config-provider'; import defaultLocale from '../../locale/en_US'; import useLocale from '../../locale/useLocale'; diff --git a/components/notification/__tests__/index.test.tsx b/components/notification/__tests__/index.test.tsx index 5229bf1de4..18ca10ab8b 100644 --- a/components/notification/__tests__/index.test.tsx +++ b/components/notification/__tests__/index.test.tsx @@ -1,5 +1,6 @@ -import { UserOutlined } from '@ant-design/icons'; import React from 'react'; +import { UserOutlined } from '@ant-design/icons'; + import notification, { actWrapper } from '..'; import { act, fireEvent } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/notification/__tests__/static-warning.test.tsx b/components/notification/__tests__/static-warning.test.tsx index d19e853298..96ebc5e2b7 100644 --- a/components/notification/__tests__/static-warning.test.tsx +++ b/components/notification/__tests__/static-warning.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import notification, { actWrapper } from '..'; import { act, render, waitFakeTimer } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/notification/interface.ts b/components/notification/interface.ts index 74ff8053ff..53ecbcbb53 100644 --- a/components/notification/interface.ts +++ b/components/notification/interface.ts @@ -1,4 +1,5 @@ import type * as React from 'react'; + import type { ClosableType } from '../_util/hooks/useClosable'; interface DivProps extends React.HTMLProps { diff --git a/components/notification/style/index.ts b/components/notification/style/index.ts index ee3bdc9593..f9f3c91c17 100644 --- a/components/notification/style/index.ts +++ b/components/notification/style/index.ts @@ -2,12 +2,12 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes, unit } from '@ant-design/cssinjs'; import { CONTAINER_MAX_OFFSET } from '../../_util/hooks/useZIndex'; -import { resetComponent, genFocusStyle } from '../../style'; +import { genFocusStyle, resetComponent } from '../../style'; import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; +import type { GenStyleFn } from '../../theme/util/genComponentStyleHook'; import genNotificationPlacementStyle from './placement'; import genStackStyle from './stack'; -import type { GenStyleFn } from '../../theme/util/genComponentStyleHook'; /** Component only token. Which will handle additional calculation of alias token */ export interface ComponentToken { diff --git a/components/notification/style/placement.ts b/components/notification/style/placement.ts index 98212fbafb..efd8c7d6f6 100644 --- a/components/notification/style/placement.ts +++ b/components/notification/style/placement.ts @@ -1,5 +1,6 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; + import type { NotificationToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/notification/style/pure-panel.ts b/components/notification/style/pure-panel.ts index b00dbc8fef..ffa501fa1e 100644 --- a/components/notification/style/pure-panel.ts +++ b/components/notification/style/pure-panel.ts @@ -1,7 +1,8 @@ -import { genSubStyleComponent } from '../../theme/internal'; -import { prepareComponentToken, genNoticeStyle, prepareNotificationToken } from '.'; import { unit } from '@ant-design/cssinjs'; +import { genNoticeStyle, prepareComponentToken, prepareNotificationToken } from '.'; +import { genSubStyleComponent } from '../../theme/internal'; + export default genSubStyleComponent( ['Notification', 'PurePanel'], (token) => { diff --git a/components/notification/style/stack.ts b/components/notification/style/stack.ts index c2912496c1..909ded1fb2 100644 --- a/components/notification/style/stack.ts +++ b/components/notification/style/stack.ts @@ -1,6 +1,7 @@ -import type { GenerateStyle } from '../../theme/internal'; -import type { NotificationToken } from '.'; import type { CSSObject } from '@ant-design/cssinjs'; + +import type { NotificationToken } from '.'; +import type { GenerateStyle } from '../../theme/internal'; import type { NotificationPlacement } from '../interface'; import { NotificationPlacements } from '../interface'; diff --git a/components/notification/util.ts b/components/notification/util.ts index 2fd218d9b9..3dcacac69b 100644 --- a/components/notification/util.ts +++ b/components/notification/util.ts @@ -1,5 +1,6 @@ import type * as React from 'react'; import type { CSSMotionProps } from 'rc-motion'; + import type { NotificationPlacement } from './interface'; export function getPlacementStyle(placement: NotificationPlacement, top: number, bottom: number) { diff --git a/components/pagination/Pagination.tsx b/components/pagination/Pagination.tsx index dec866b2b7..62ce511ca0 100644 --- a/components/pagination/Pagination.tsx +++ b/components/pagination/Pagination.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import DoubleLeftOutlined from '@ant-design/icons/DoubleLeftOutlined'; import DoubleRightOutlined from '@ant-design/icons/DoubleRightOutlined'; import LeftOutlined from '@ant-design/icons/LeftOutlined'; @@ -6,14 +7,14 @@ import classNames from 'classnames'; import type { PaginationLocale, PaginationProps as RcPaginationProps } from 'rc-pagination'; import RcPagination from 'rc-pagination'; import enUS from 'rc-pagination/lib/locale/en_US'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import useSize from '../config-provider/hooks/useSize'; import useBreakpoint from '../grid/hooks/useBreakpoint'; import { useLocale } from '../locale'; +import { useToken } from '../theme/internal'; import { MiddleSelect, MiniSelect } from './Select'; import useStyle from './style'; -import { useToken } from '../theme/internal'; import BorderedStyle from './style/bordered'; export interface PaginationProps extends RcPaginationProps { diff --git a/components/pagination/Select.tsx b/components/pagination/Select.tsx index 49fc5c8342..d4bb9192a3 100644 --- a/components/pagination/Select.tsx +++ b/components/pagination/Select.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { SelectProps } from '../select'; import Select from '../select'; diff --git a/components/pagination/__tests__/index.test.tsx b/components/pagination/__tests__/index.test.tsx index 6e464657fe..3658615886 100644 --- a/components/pagination/__tests__/index.test.tsx +++ b/components/pagination/__tests__/index.test.tsx @@ -1,5 +1,6 @@ -import type { OptionFC } from 'rc-select/lib/Option'; import React from 'react'; +import type { OptionFC } from 'rc-select/lib/Option'; + import type { PaginationProps } from '..'; import Pagination from '..'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/pagination/__tests__/simple.test.tsx b/components/pagination/__tests__/simple.test.tsx index 765a911d5a..adbf1430bd 100644 --- a/components/pagination/__tests__/simple.test.tsx +++ b/components/pagination/__tests__/simple.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Pagination from '..'; import { render } from '../../../tests/utils'; diff --git a/components/pagination/style/bordered.ts b/components/pagination/style/bordered.ts index c48d72605a..2275d547c6 100644 --- a/components/pagination/style/bordered.ts +++ b/components/pagination/style/bordered.ts @@ -1,8 +1,9 @@ -import { genSubStyleComponent } from '../../theme/util/genComponentStyleHook'; +import { unit } from '@ant-design/cssinjs'; + import type { PaginationToken } from '.'; import { prepareComponentToken, prepareToken } from '.'; import type { GenerateStyle } from '../../theme/interface'; -import { unit } from '@ant-design/cssinjs'; +import { genSubStyleComponent } from '../../theme/util/genComponentStyleHook'; const genBorderedStyle: GenerateStyle = (token) => { const { componentCls } = token; diff --git a/components/pagination/style/index.ts b/components/pagination/style/index.ts index b5a88fc88a..3643737f7c 100644 --- a/components/pagination/style/index.ts +++ b/components/pagination/style/index.ts @@ -1,16 +1,18 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; -import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; +import type { GenStyleFn } from 'antd/es/theme/util/genComponentStyleHook'; + import { genBasicInputStyle, genInputSmallStyle, initComponentToken, initInputToken, } from '../../input/style'; +import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; +import { genBaseOutlinedStyle, genDisabledStyle } from '../../input/style/variants'; import { genFocusOutline, genFocusStyle, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; -import type { GenStyleFn } from 'antd/es/theme/util/genComponentStyleHook'; -import { genBaseOutlinedStyle, genDisabledStyle } from '../../input/style/variants'; export interface ComponentToken { /** diff --git a/components/popconfirm/PurePanel.tsx b/components/popconfirm/PurePanel.tsx index f7c870fe73..481eaaaa1f 100644 --- a/components/popconfirm/PurePanel.tsx +++ b/components/popconfirm/PurePanel.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; import classNames from 'classnames'; -import * as React from 'react'; + import type { PopconfirmProps } from '.'; import ActionButton from '../_util/ActionButton'; import { getRenderPropValue } from '../_util/getRenderPropValue'; diff --git a/components/popconfirm/__tests__/demo.test.tsx b/components/popconfirm/__tests__/demo.test.tsx index ae0f7f0816..cbcf8b290e 100644 --- a/components/popconfirm/__tests__/demo.test.tsx +++ b/components/popconfirm/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('popconfirm', { diff --git a/components/popconfirm/__tests__/type.test.tsx b/components/popconfirm/__tests__/type.test.tsx index 938e790f2c..c85703d0ae 100644 --- a/components/popconfirm/__tests__/type.test.tsx +++ b/components/popconfirm/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Popconfirm from '..'; describe('Popconfirm.typescript', () => { diff --git a/components/popconfirm/demo/icon.tsx b/components/popconfirm/demo/icon.tsx index 8dc8c88a26..decf938a27 100644 --- a/components/popconfirm/demo/icon.tsx +++ b/components/popconfirm/demo/icon.tsx @@ -1,5 +1,5 @@ -import { QuestionCircleOutlined } from '@ant-design/icons'; import React from 'react'; +import { QuestionCircleOutlined } from '@ant-design/icons'; import { Button, Popconfirm } from 'antd'; const App: React.FC = () => ( diff --git a/components/popconfirm/demo/placement.tsx b/components/popconfirm/demo/placement.tsx index 17546ebdac..1569834b86 100644 --- a/components/popconfirm/demo/placement.tsx +++ b/components/popconfirm/demo/placement.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Popconfirm, ConfigProvider } from 'antd'; +import { Button, ConfigProvider, Popconfirm } from 'antd'; const text = 'Are you sure to delete this task?'; const description = 'Delete the task'; diff --git a/components/popover/demo/placement.tsx b/components/popover/demo/placement.tsx index 6debfc2f8d..4aa73ff5e0 100644 --- a/components/popover/demo/placement.tsx +++ b/components/popover/demo/placement.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Popover, ConfigProvider } from 'antd'; +import { Button, ConfigProvider, Popover } from 'antd'; const text = Title; diff --git a/components/popover/index.tsx b/components/popover/index.tsx index 4528b82791..5ff318b431 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -1,9 +1,12 @@ import * as React from 'react'; import classNames from 'classnames'; +import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import KeyCode from 'rc-util/lib/KeyCode'; import type { RenderFunction } from '../_util/getRenderPropValue'; import { getRenderPropValue } from '../_util/getRenderPropValue'; import { getTransitionName } from '../_util/motion'; +import { cloneElement } from '../_util/reactNode'; import { ConfigContext } from '../config-provider'; import type { AbstractTooltipProps, TooltipRef } from '../tooltip'; import Tooltip from '../tooltip'; @@ -11,10 +14,6 @@ import PurePanel from './PurePanel'; // CSSINJS import useStyle from './style'; -import KeyCode from 'rc-util/lib/KeyCode'; -import { cloneElement } from '../_util/reactNode'; -import useMergedState from 'rc-util/lib/hooks/useMergedState'; - export interface PopoverProps extends AbstractTooltipProps { title?: React.ReactNode | RenderFunction; content?: React.ReactNode | RenderFunction; diff --git a/components/popover/style/index.ts b/components/popover/style/index.ts index ec4f06a204..343b4aa55d 100644 --- a/components/popover/style/index.ts +++ b/components/popover/style/index.ts @@ -2,15 +2,15 @@ import { resetComponent } from '../../style'; import { initZoomMotion } from '../../style/motion'; import type { ArrowOffsetToken } from '../../style/placementArrow'; import getArrowStyle, { getArrowOffsetToken } from '../../style/placementArrow'; +import type { ArrowToken } from '../../style/roundedArrow'; +import { getArrowToken } from '../../style/roundedArrow'; import type { FullToken, GenerateStyle, GetDefaultToken, PresetColorType, } from '../../theme/internal'; -import { PresetColors, genStyleHooks, mergeToken } from '../../theme/internal'; -import type { ArrowToken } from '../../style/roundedArrow'; -import { getArrowToken } from '../../style/roundedArrow'; +import { genStyleHooks, mergeToken, PresetColors } from '../../theme/internal'; export interface ComponentToken extends ArrowToken, ArrowOffsetToken { /** diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index 7cf8d7c883..a0e81d98fa 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -1,7 +1,8 @@ +import * as React from 'react'; import classNames from 'classnames'; import type { ProgressProps as RcProgressProps } from 'rc-progress'; import { Circle as RCCircle } from 'rc-progress'; -import * as React from 'react'; + import Tooltip from '../tooltip'; import type { ProgressGradient, ProgressProps } from './progress'; import { getPercentage, getSize, getStrokeColor } from './utils'; diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index b8c249d220..a212ed2e39 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -4,8 +4,8 @@ import { presetPrimaryColors } from '@ant-design/colors'; import { devUseWarning } from '../_util/warning'; import type { DirectionType } from '../config-provider'; import type { ProgressGradient, ProgressProps, StringGradients } from './progress'; -import { getSize, getSuccessPercent, validProgress } from './utils'; import { LineStrokeColorVar, Percent } from './style'; +import { getSize, getSuccessPercent, validProgress } from './utils'; interface LineProps extends ProgressProps { prefixCls: string; diff --git a/components/progress/Steps.tsx b/components/progress/Steps.tsx index 85f7c27b59..ff28cd2590 100644 --- a/components/progress/Steps.tsx +++ b/components/progress/Steps.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import type { ProgressProps } from './progress'; import { getSize } from './utils'; diff --git a/components/progress/__tests__/index.test.tsx b/components/progress/__tests__/index.test.tsx index 33113dc436..31792105ce 100644 --- a/components/progress/__tests__/index.test.tsx +++ b/components/progress/__tests__/index.test.tsx @@ -1,13 +1,14 @@ import React, { useState } from 'react'; import { Tooltip } from 'antd'; + import type { ProgressProps } from '..'; import Progress from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; import { handleGradient, sortGradient } from '../Line'; -import ProgressSteps from '../Steps'; import { ProgressTypes } from '../progress'; +import ProgressSteps from '../Steps'; describe('Progress', () => { mountTest(Progress); diff --git a/components/qr-code/demo/Popover.tsx b/components/qr-code/demo/Popover.tsx index bca234e52c..f2f17514ec 100644 --- a/components/qr-code/demo/Popover.tsx +++ b/components/qr-code/demo/Popover.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { QRCode, Popover, Button } from 'antd'; +import { Button, Popover, QRCode } from 'antd'; const App: React.FC = () => ( { const [level, setLevel] = useState('L'); diff --git a/components/radio/__tests__/demo.test.tsx b/components/radio/__tests__/demo.test.tsx index 720cdbde0b..cfe0170317 100644 --- a/components/radio/__tests__/demo.test.tsx +++ b/components/radio/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('radio'); diff --git a/components/radio/__tests__/radio-button.test.tsx b/components/radio/__tests__/radio-button.test.tsx index 55aab9f7fe..c7197ec7bf 100644 --- a/components/radio/__tests__/radio-button.test.tsx +++ b/components/radio/__tests__/radio-button.test.tsx @@ -1,10 +1,10 @@ import React from 'react'; + import type { RadioGroupProps } from '..'; import Radio, { Button } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; - import { fireEvent, render } from '../../../tests/utils'; describe('Radio Button', () => { diff --git a/components/radio/__tests__/radio.test.tsx b/components/radio/__tests__/radio.test.tsx index 010b3235e3..7253b13c89 100644 --- a/components/radio/__tests__/radio.test.tsx +++ b/components/radio/__tests__/radio.test.tsx @@ -1,11 +1,11 @@ import React from 'react'; + import Radio, { Button, Group } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import Form from '../../form'; - import { fireEvent, render } from '../../../tests/utils'; +import Form from '../../form'; describe('Radio', () => { focusTest(Radio, { refFocus: true }); diff --git a/components/radio/__tests__/type.test.tsx b/components/radio/__tests__/type.test.tsx index 3544855535..689d287906 100644 --- a/components/radio/__tests__/type.test.tsx +++ b/components/radio/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Radio from '..'; import type { RadioRef } from '..'; diff --git a/components/radio/context.ts b/components/radio/context.ts index 46cf29de64..139938b7b5 100644 --- a/components/radio/context.ts +++ b/components/radio/context.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { RadioGroupContextProps, RadioOptionTypeContextProps } from './interface'; const RadioGroupContext = React.createContext(null); diff --git a/components/radio/group.tsx b/components/radio/group.tsx index 5fe7047486..28e81971ee 100644 --- a/components/radio/group.tsx +++ b/components/radio/group.tsx @@ -4,12 +4,12 @@ import useMergedState from 'rc-util/lib/hooks/useMergedState'; import pickAttrs from 'rc-util/lib/pickAttrs'; import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import useSize from '../config-provider/hooks/useSize'; import { RadioGroupContextProvider } from './context'; import type { RadioChangeEvent, RadioGroupButtonStyle, RadioGroupProps } from './interface'; import Radio from './radio'; import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; const RadioGroup = React.forwardRef((props, ref) => { const { getPrefixCls, direction } = React.useContext(ConfigContext); diff --git a/components/radio/index.ts b/components/radio/index.ts index a06656fdb1..3be20270c4 100644 --- a/components/radio/index.ts +++ b/components/radio/index.ts @@ -1,4 +1,5 @@ import type * as React from 'react'; + import Group from './group'; import type { RadioProps, RadioRef } from './interface'; import InternalRadio from './radio'; diff --git a/components/radio/interface.ts b/components/radio/interface.ts index e6878c2c4f..7c87efc83b 100644 --- a/components/radio/interface.ts +++ b/components/radio/interface.ts @@ -1,4 +1,5 @@ import type * as React from 'react'; + import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; import type { AbstractCheckboxGroupProps } from '../checkbox/Group'; import type { DisabledType } from '../config-provider/DisabledContext'; diff --git a/components/radio/radioButton.tsx b/components/radio/radioButton.tsx index 736793512e..f38a3642e1 100644 --- a/components/radio/radioButton.tsx +++ b/components/radio/radioButton.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; import { ConfigContext } from '../config-provider'; import { RadioOptionTypeContextProvider } from './context'; diff --git a/components/radio/style/index.ts b/components/radio/style/index.ts index 5b16872dd9..47e959b899 100644 --- a/components/radio/style/index.ts +++ b/components/radio/style/index.ts @@ -1,4 +1,5 @@ import { unit } from '@ant-design/cssinjs'; + import { genFocusOutline, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/rate/style/index.ts b/components/rate/style/index.ts index eeb52ef35c..2f6f03b2fc 100644 --- a/components/rate/style/index.ts +++ b/components/rate/style/index.ts @@ -1,8 +1,9 @@ import type { CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; export type ComponentToken = { /** diff --git a/components/result/__tests__/index.test.tsx b/components/result/__tests__/index.test.tsx index fb64c42942..a327f5fd48 100644 --- a/components/result/__tests__/index.test.tsx +++ b/components/result/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Result from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/result/__tests__/type.test.tsx b/components/result/__tests__/type.test.tsx index 14d8f6d7fb..4f11672dd4 100644 --- a/components/result/__tests__/type.test.tsx +++ b/components/result/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Result from '..'; describe('Result.typescript', () => { diff --git a/components/result/style/index.ts b/components/result/style/index.ts index 8fb3090ecd..b8a454c04a 100644 --- a/components/result/style/index.ts +++ b/components/result/style/index.ts @@ -1,6 +1,7 @@ import type { CSSProperties } from 'react'; import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; + import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/row/index.ts b/components/row/index.ts index 81cf63c1f2..0a0ec3a3da 100644 --- a/components/row/index.ts +++ b/components/row/index.ts @@ -1,4 +1,5 @@ -import { Row, type RowProps } from '../grid'; +import { Row } from '../grid'; +import type { RowProps } from '../grid'; export type { RowProps }; export default Row; diff --git a/components/segmented/index.tsx b/components/segmented/index.tsx index bdc8069330..ca4b591832 100644 --- a/components/segmented/index.tsx +++ b/components/segmented/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import classNames from 'classnames'; import type { SegmentedLabeledOption as RcSegmentedLabeledOption, @@ -6,7 +7,7 @@ import type { SegmentedRawOption, } from 'rc-segmented'; import RcSegmented from 'rc-segmented'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import useSize from '../config-provider/hooks/useSize'; import type { SizeType } from '../config-provider/SizeContext'; diff --git a/components/segmented/style/index.ts b/components/segmented/style/index.ts index 2fb379183d..c98a38bd80 100644 --- a/components/segmented/style/index.ts +++ b/components/segmented/style/index.ts @@ -1,9 +1,9 @@ import type { CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; import { resetComponent, textEllipsis } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; export interface ComponentToken { /** diff --git a/components/select/__tests__/demo.test.tsx b/components/select/__tests__/demo.test.tsx index ab5b0dd5b3..ddb01d5c5c 100644 --- a/components/select/__tests__/demo.test.tsx +++ b/components/select/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('select', { diff --git a/components/select/demo/custom-dropdown-menu.tsx b/components/select/demo/custom-dropdown-menu.tsx index ebdc7ee0a2..f2fe9e7cca 100644 --- a/components/select/demo/custom-dropdown-menu.tsx +++ b/components/select/demo/custom-dropdown-menu.tsx @@ -1,6 +1,6 @@ -import React, { useState, useRef } from 'react'; +import React, { useRef, useState } from 'react'; import { PlusOutlined } from '@ant-design/icons'; -import { Divider, Input, Select, Space, Button } from 'antd'; +import { Button, Divider, Input, Select, Space } from 'antd'; import type { InputRef } from 'antd'; let index = 0; diff --git a/components/select/demo/option-label-center.tsx b/components/select/demo/option-label-center.tsx index 601bde002e..d0b92de9d1 100644 --- a/components/select/demo/option-label-center.tsx +++ b/components/select/demo/option-label-center.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Select, Space, Cascader, Typography, TreeSelect } from 'antd'; +import { Cascader, Select, Space, TreeSelect, Typography } from 'antd'; const options = [ { value: 'long', label: long, long, long piece of text }, diff --git a/components/select/demo/render-panel.tsx b/components/select/demo/render-panel.tsx index a4658a1b50..ecb9e0a334 100644 --- a/components/select/demo/render-panel.tsx +++ b/components/select/demo/render-panel.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Select, Switch, Space } from 'antd'; +import { Select, Space, Switch } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: InternalSelect } = Select; diff --git a/components/select/demo/search-box.tsx b/components/select/demo/search-box.tsx index 7c68194032..7536956909 100644 --- a/components/select/demo/search-box.tsx +++ b/components/select/demo/search-box.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import jsonp from 'fetch-jsonp'; -import qs from 'qs'; import { Select } from 'antd'; import type { SelectProps } from 'antd'; +import jsonp from 'fetch-jsonp'; +import qs from 'qs'; let timeout: ReturnType | null; let currentValue: string; diff --git a/components/select/style/dropdown.ts b/components/select/style/dropdown.ts index 35548cc68b..b0c42c50a0 100644 --- a/components/select/style/dropdown.ts +++ b/components/select/style/dropdown.ts @@ -1,5 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; -import type { SelectToken } from './token'; + import { resetComponent, textEllipsis } from '../../style'; import { initMoveMotion, @@ -10,6 +10,7 @@ import { slideUpOut, } from '../../style/motion'; import type { GenerateStyle } from '../../theme/internal'; +import type { SelectToken } from './token'; const genItemStyle: GenerateStyle = (token) => { const { optionHeight, optionFontSize, optionLineHeight, optionPadding } = token; diff --git a/components/select/style/index.ts b/components/select/style/index.ts index 00e5a24c78..3cb7d0892c 100644 --- a/components/select/style/index.ts +++ b/components/select/style/index.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import { resetComponent, resetIcon, textEllipsis } from '../../style'; import { genCompactItemStyle } from '../../style/compact-item'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/select/style/multiple.ts b/components/select/style/multiple.ts index d13b42148e..30cee9cd96 100644 --- a/components/select/style/multiple.ts +++ b/components/select/style/multiple.ts @@ -2,7 +2,8 @@ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; import { resetIcon } from '../../style'; -import { mergeToken, type AliasToken } from '../../theme/internal'; +import { mergeToken } from '../../theme/internal'; +import type { AliasToken } from '../../theme/internal'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import type { SelectToken } from './token'; diff --git a/components/select/style/single.ts b/components/select/style/single.ts index a929f9f8f5..604b957e60 100644 --- a/components/select/style/single.ts +++ b/components/select/style/single.ts @@ -1,9 +1,10 @@ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; -import { resetComponent } from '../../style'; -import type { SelectToken } from './token'; -import { mergeToken } from '../../theme/internal'; import { unit } from '@ant-design/cssinjs'; +import { resetComponent } from '../../style'; +import { mergeToken } from '../../theme/internal'; +import type { SelectToken } from './token'; + function genSizeStyle(token: SelectToken, suffix?: string): CSSObject { const { componentCls, inputPaddingHorizontalBase, borderRadius } = token; diff --git a/components/select/style/variants.ts b/components/select/style/variants.ts index fcdcb790a5..860c1dbc15 100644 --- a/components/select/style/variants.ts +++ b/components/select/style/variants.ts @@ -1,7 +1,8 @@ import type { CSSObject } from '@ant-design/cssinjs'; -import type { SelectToken } from './token'; import { unit } from '@ant-design/cssinjs'; +import type { SelectToken } from './token'; + // ===================================================== // == Outlined == // ===================================================== diff --git a/components/skeleton/Avatar.tsx b/components/skeleton/Avatar.tsx index b37fa64216..6953eeaa20 100644 --- a/components/skeleton/Avatar.tsx +++ b/components/skeleton/Avatar.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; diff --git a/components/skeleton/Button.tsx b/components/skeleton/Button.tsx index 0645d6ec53..be414299c2 100644 --- a/components/skeleton/Button.tsx +++ b/components/skeleton/Button.tsx @@ -1,10 +1,10 @@ +import * as React from 'react'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; - import useStyle from './style'; export interface SkeletonButtonProps extends Omit { diff --git a/components/skeleton/Element.tsx b/components/skeleton/Element.tsx index 160e07629c..a4852c18f6 100644 --- a/components/skeleton/Element.tsx +++ b/components/skeleton/Element.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; export interface SkeletonElementProps { prefixCls?: string; diff --git a/components/skeleton/Image.tsx b/components/skeleton/Image.tsx index 8f0f23a0ff..4e113ad0bb 100644 --- a/components/skeleton/Image.tsx +++ b/components/skeleton/Image.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import useStyle from './style'; diff --git a/components/skeleton/Input.tsx b/components/skeleton/Input.tsx index 4df9784a8c..0ed80966fc 100644 --- a/components/skeleton/Input.tsx +++ b/components/skeleton/Input.tsx @@ -1,10 +1,10 @@ +import * as React from 'react'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; - import useStyle from './style'; export interface SkeletonInputProps extends Omit { diff --git a/components/skeleton/Node.tsx b/components/skeleton/Node.tsx index a924d26b33..2506d4c1da 100644 --- a/components/skeleton/Node.tsx +++ b/components/skeleton/Node.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import DotChartOutlined from '@ant-design/icons/DotChartOutlined'; import classNames from 'classnames'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import useStyle from './style'; diff --git a/components/skeleton/Paragraph.tsx b/components/skeleton/Paragraph.tsx index 08ad4d16fd..4e0a1168ea 100644 --- a/components/skeleton/Paragraph.tsx +++ b/components/skeleton/Paragraph.tsx @@ -1,5 +1,5 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; type widthUnit = number | string; diff --git a/components/skeleton/Skeleton.tsx b/components/skeleton/Skeleton.tsx index dc439321d2..ba9c2d9cc0 100644 --- a/components/skeleton/Skeleton.tsx +++ b/components/skeleton/Skeleton.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import { ConfigContext } from '../config-provider'; import type { AvatarProps } from './Avatar'; import SkeletonAvatar from './Avatar'; @@ -10,11 +11,10 @@ import SkeletonInput from './Input'; import SkeletonNode from './Node'; import type { SkeletonParagraphProps } from './Paragraph'; import Paragraph from './Paragraph'; +import useStyle from './style'; import type { SkeletonTitleProps } from './Title'; import Title from './Title'; -import useStyle from './style'; - /* This only for skeleton internal. */ type SkeletonAvatarProps = Omit; diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx index d1aa854030..f07cee8e46 100644 --- a/components/skeleton/Title.tsx +++ b/components/skeleton/Title.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/heading-has-content */ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; export interface SkeletonTitleProps { prefixCls?: string; diff --git a/components/skeleton/__tests__/demo.test.tsx b/components/skeleton/__tests__/demo.test.tsx index e7c77fcc9e..dc52199ccf 100644 --- a/components/skeleton/__tests__/demo.test.tsx +++ b/components/skeleton/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('skeleton'); diff --git a/components/skeleton/__tests__/index.test.tsx b/components/skeleton/__tests__/index.test.tsx index 11855feeba..85d6b524ec 100644 --- a/components/skeleton/__tests__/index.test.tsx +++ b/components/skeleton/__tests__/index.test.tsx @@ -1,14 +1,15 @@ import React from 'react'; + import Skeleton from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; -import type { SkeletonProps } from '../Skeleton'; import type { AvatarProps } from '../Avatar'; import type { SkeletonButtonProps } from '../Button'; import type { SkeletonImageProps } from '../Image'; import type { SkeletonInputProps } from '../Input'; import type { SkeletonNodeProps } from '../Node'; +import type { SkeletonProps } from '../Skeleton'; describe('Skeleton', () => { const genSkeleton = (props: SkeletonProps) => diff --git a/components/skeleton/demo/element.tsx b/components/skeleton/demo/element.tsx index c5c214eec8..405f454f1c 100644 --- a/components/skeleton/demo/element.tsx +++ b/components/skeleton/demo/element.tsx @@ -1,5 +1,5 @@ -import { DotChartOutlined } from '@ant-design/icons'; import React, { useState } from 'react'; +import { DotChartOutlined } from '@ant-design/icons'; import type { RadioChangeEvent } from 'antd'; import { Divider, Form, Radio, Skeleton, Space, Switch } from 'antd'; diff --git a/components/skeleton/demo/list.tsx b/components/skeleton/demo/list.tsx index bc384a7983..45dcc2c5c1 100644 --- a/components/skeleton/demo/list.tsx +++ b/components/skeleton/demo/list.tsx @@ -1,6 +1,6 @@ +import React, { useState } from 'react'; import type Icon from '@ant-design/icons'; import { LikeOutlined, MessageOutlined, StarOutlined } from '@ant-design/icons'; -import React, { useState } from 'react'; import { Avatar, List, Skeleton, Switch } from 'antd'; interface IconTextProps { diff --git a/components/skeleton/style/index.ts b/components/skeleton/style/index.ts index 900661aa73..934202d802 100644 --- a/components/skeleton/style/index.ts +++ b/components/skeleton/style/index.ts @@ -1,5 +1,6 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { Keyframes, unit } from '@ant-design/cssinjs'; + import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; import type { CSSUtil } from '../../theme/util/genComponentStyleHook'; diff --git a/components/slider/SliderTooltip.tsx b/components/slider/SliderTooltip.tsx index 0cbbc92f2c..428a870513 100644 --- a/components/slider/SliderTooltip.tsx +++ b/components/slider/SliderTooltip.tsx @@ -1,8 +1,9 @@ +import * as React from 'react'; +import { useRef } from 'react'; import type { SliderRef } from 'rc-slider/lib/Slider'; import raf from 'rc-util/lib/raf'; import { composeRef } from 'rc-util/lib/ref'; -import * as React from 'react'; -import { useRef } from 'react'; + import type { TooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; diff --git a/components/slider/__tests__/index.test.tsx b/components/slider/__tests__/index.test.tsx index 4a601deda3..1cf6afe969 100644 --- a/components/slider/__tests__/index.test.tsx +++ b/components/slider/__tests__/index.test.tsx @@ -1,10 +1,11 @@ import React from 'react'; + import Slider from '..'; +import { resetWarned } from '../../_util/warning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; import ConfigProvider from '../../config-provider'; import type { TooltipProps, TooltipRef } from '../../tooltip'; import SliderTooltip from '../SliderTooltip'; diff --git a/components/slider/style/index.ts b/components/slider/style/index.ts index f6c523b3bc..0e6601d578 100644 --- a/components/slider/style/index.ts +++ b/components/slider/style/index.ts @@ -1,11 +1,11 @@ import type * as React from 'react'; import type { CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; // Direction naming standard: // Horizontal base: diff --git a/components/space/Compact.tsx b/components/space/Compact.tsx index aacb2d55db..4eea5baf97 100644 --- a/components/space/Compact.tsx +++ b/components/space/Compact.tsx @@ -1,12 +1,11 @@ +import * as React from 'react'; import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; -import * as React from 'react'; import type { DirectionType } from '../config-provider'; import { ConfigContext } from '../config-provider'; -import type { SizeType } from '../config-provider/SizeContext'; - import useSize from '../config-provider/hooks/useSize'; +import type { SizeType } from '../config-provider/SizeContext'; import useStyle from './style'; export interface SpaceCompactItemContextType { diff --git a/components/space/__tests__/space-compact.test.tsx b/components/space/__tests__/space-compact.test.tsx index 484fe1b79a..8fc2f4cc77 100644 --- a/components/space/__tests__/space-compact.test.tsx +++ b/components/space/__tests__/space-compact.test.tsx @@ -1,5 +1,6 @@ /* eslint-disable no-console */ import React from 'react'; + import Space from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/space/demo/compact-buttons.tsx b/components/space/demo/compact-buttons.tsx index 03f3d83bfa..17ad06318c 100644 --- a/components/space/demo/compact-buttons.tsx +++ b/components/space/demo/compact-buttons.tsx @@ -1,17 +1,17 @@ import React from 'react'; import { + CommentOutlined, DownloadOutlined, EllipsisOutlined, HeartOutlined, LikeOutlined, - CommentOutlined, - StarOutlined, - ShareAltOutlined, - WarningOutlined, MailOutlined, MobileOutlined, + ShareAltOutlined, + StarOutlined, + WarningOutlined, } from '@ant-design/icons'; -import { Button, Menu, Dropdown, Space, Tooltip } from 'antd'; +import { Button, Dropdown, Menu, Space, Tooltip } from 'antd'; const App: React.FC = () => (
diff --git a/components/space/demo/compact-debug.tsx b/components/space/demo/compact-debug.tsx index 014090376a..514d372bbe 100644 --- a/components/space/demo/compact-debug.tsx +++ b/components/space/demo/compact-debug.tsx @@ -1,19 +1,19 @@ import React, { useState } from 'react'; -import { SettingOutlined, CopyOutlined, DownloadOutlined } from '@ant-design/icons'; +import { CopyOutlined, DownloadOutlined, SettingOutlined } from '@ant-design/icons'; import { + Button, Cascader, + DatePicker, + Divider, + Drawer, + Dropdown, Input, + InputNumber, + Modal, + Popover, Select, Space, - Button, Tooltip, - Modal, - Dropdown, - Drawer, - InputNumber, - DatePicker, - Popover, - Divider, } from 'antd'; const { Option } = Select; diff --git a/components/space/demo/compact-nested.tsx b/components/space/demo/compact-nested.tsx index e7a568a82f..9a78464984 100644 --- a/components/space/demo/compact-nested.tsx +++ b/components/space/demo/compact-nested.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { CopyOutlined, SearchOutlined } from '@ant-design/icons'; -import { Button, Cascader, Input, InputNumber, Space, Select, TimePicker } from 'antd'; +import { Button, Cascader, Input, InputNumber, Select, Space, TimePicker } from 'antd'; const { Option } = Select; diff --git a/components/spin/__tests__/delay.test.tsx b/components/spin/__tests__/delay.test.tsx index c29849e435..b50bb55b1a 100644 --- a/components/spin/__tests__/delay.test.tsx +++ b/components/spin/__tests__/delay.test.tsx @@ -1,6 +1,7 @@ -import { render } from '@testing-library/react'; import React from 'react'; +import { render } from '@testing-library/react'; import { debounce } from 'throttle-debounce'; + import Spin from '..'; import { waitFakeTimer } from '../../../tests/utils'; diff --git a/components/spin/__tests__/index.test.tsx b/components/spin/__tests__/index.test.tsx index 25d2f955d7..1c591d9c07 100644 --- a/components/spin/__tests__/index.test.tsx +++ b/components/spin/__tests__/index.test.tsx @@ -69,7 +69,9 @@ describe('Spin', () => { const { container } = render(); expect(container.querySelector('.ant-spin-text')).toBeFalsy(); - expect(errSpy).toHaveBeenCalledWith('Warning: [antd: Spin] `tip` only work in nest or fullscreen pattern.'); + expect(errSpy).toHaveBeenCalledWith( + 'Warning: [antd: Spin] `tip` only work in nest or fullscreen pattern.', + ); errSpy.mockRestore(); }); diff --git a/components/statistic/Number.tsx b/components/statistic/Number.tsx index 9590c68d50..9c6d8d596b 100644 --- a/components/statistic/Number.tsx +++ b/components/statistic/Number.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { FormatConfig, valueType } from './utils'; interface NumberProps extends FormatConfig { diff --git a/components/statistic/Statistic.tsx b/components/statistic/Statistic.tsx index 8907bdb6d9..8e0908500b 100644 --- a/components/statistic/Statistic.tsx +++ b/components/statistic/Statistic.tsx @@ -1,14 +1,14 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; import pickAttrs from 'rc-util/lib/pickAttrs'; +import type { HTMLAriaDataAttributes } from '../_util/aria-data-attrs'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; import Skeleton from '../skeleton'; import StatisticNumber from './Number'; import useStyle from './style'; import type { FormatConfig, valueType } from './utils'; -import type { HTMLAriaDataAttributes } from '../_util/aria-data-attrs'; interface StatisticReactProps extends FormatConfig { prefixCls?: string; diff --git a/components/statistic/style/index.ts b/components/statistic/style/index.ts index 2bccac8907..e3bc1c76f2 100644 --- a/components/statistic/style/index.ts +++ b/components/statistic/style/index.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/steps/__tests__/index.test.tsx b/components/steps/__tests__/index.test.tsx index 1998b59b91..e3abbc76d0 100644 --- a/components/steps/__tests__/index.test.tsx +++ b/components/steps/__tests__/index.test.tsx @@ -1,9 +1,10 @@ import React from 'react'; + import Steps from '..'; +import { resetWarned } from '../../_util/warning'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render, screen } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; import ConfigProvider from '../../config-provider'; describe('Steps', () => { diff --git a/components/steps/demo/progress-debug.tsx b/components/steps/demo/progress-debug.tsx index 297620bdaf..591feb801a 100644 --- a/components/steps/demo/progress-debug.tsx +++ b/components/steps/demo/progress-debug.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import type { StepsProps } from 'antd'; -import { Button, Steps, Space } from 'antd'; +import { Button, Space, Steps } from 'antd'; const App: React.FC = () => { const [percent, setPercentage] = useState(0); diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 60ae65cf21..1475422fb8 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; @@ -7,7 +8,7 @@ import type { StepsProps as RcStepsProps, StepIconRender, } from 'rc-steps/lib/Steps'; -import * as React from 'react'; + import { ConfigContext } from '../config-provider'; import useSize from '../config-provider/hooks/useSize'; import useBreakpoint from '../grid/hooks/useBreakpoint'; diff --git a/components/steps/style/custom-icon.ts b/components/steps/style/custom-icon.ts index 1d9964312b..01911178fa 100644 --- a/components/steps/style/custom-icon.ts +++ b/components/steps/style/custom-icon.ts @@ -1,6 +1,7 @@ import type { CSSObject } from '@ant-design/cssinjs'; -import type { StepsToken } from '.'; import { unit } from '@ant-design/cssinjs'; + +import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; const genStepsCustomIconStyle: GenerateStyle = (token) => { diff --git a/components/steps/style/index.ts b/components/steps/style/index.ts index 8fa2020142..ddece39f8f 100644 --- a/components/steps/style/index.ts +++ b/components/steps/style/index.ts @@ -1,5 +1,7 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; import type { CSSProperties } from 'react'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import { genFocusOutline, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/steps/style/inline.ts b/components/steps/style/inline.ts index 44180e6676..99a584a313 100644 --- a/components/steps/style/inline.ts +++ b/components/steps/style/inline.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/label-placement.ts b/components/steps/style/label-placement.ts index bbcd172a90..26f2ad09dc 100644 --- a/components/steps/style/label-placement.ts +++ b/components/steps/style/label-placement.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/nav.ts b/components/steps/style/nav.ts index a443fdb5ee..813f23c059 100644 --- a/components/steps/style/nav.ts +++ b/components/steps/style/nav.ts @@ -1,6 +1,8 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; -import { textEllipsis } from '../../style'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; +import { textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; const genStepsNavStyle: GenerateStyle = (token) => { diff --git a/components/steps/style/progress-dot.ts b/components/steps/style/progress-dot.ts index 3c165d1605..3dd12756be 100644 --- a/components/steps/style/progress-dot.ts +++ b/components/steps/style/progress-dot.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/progress.ts b/components/steps/style/progress.ts index 1ee5b0db06..380183b94e 100644 --- a/components/steps/style/progress.ts +++ b/components/steps/style/progress.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/rtl.ts b/components/steps/style/rtl.ts index d69af569df..b0955c03e9 100644 --- a/components/steps/style/rtl.ts +++ b/components/steps/style/rtl.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/small.ts b/components/steps/style/small.ts index 13544cdec4..cdef71ac4c 100644 --- a/components/steps/style/small.ts +++ b/components/steps/style/small.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/steps/style/vertical.ts b/components/steps/style/vertical.ts index d85c7fe070..ba6bbd328c 100644 --- a/components/steps/style/vertical.ts +++ b/components/steps/style/vertical.ts @@ -1,4 +1,6 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { StepsToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/style/compact-item-vertical.ts b/components/style/compact-item-vertical.ts index dd50ca7764..8d6125f67a 100644 --- a/components/style/compact-item-vertical.ts +++ b/components/style/compact-item-vertical.ts @@ -1,5 +1,6 @@ /* eslint-disable import/prefer-default-export */ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; + import type { AliasToken, FullToken } from '../theme/internal'; import type { CSSUtil, OverrideComponent } from '../theme/util/genComponentStyleHook'; diff --git a/components/style/compact-item.ts b/components/style/compact-item.ts index bbdda7da0c..7f5e94f8fd 100644 --- a/components/style/compact-item.ts +++ b/components/style/compact-item.ts @@ -1,7 +1,8 @@ /* eslint-disable import/prefer-default-export */ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; -import type { FullToken, AliasToken } from '../theme/internal'; -import type { OverrideComponent, CSSUtil } from '../theme/util/genComponentStyleHook'; + +import type { AliasToken, FullToken } from '../theme/internal'; +import type { CSSUtil, OverrideComponent } from '../theme/util/genComponentStyleHook'; interface CompactItemOptions { focus?: boolean; diff --git a/components/style/index.ts b/components/style/index.ts index b42d1bae65..2915ea84b8 100644 --- a/components/style/index.ts +++ b/components/style/index.ts @@ -1,5 +1,6 @@ /* eslint-disable import/prefer-default-export */ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { AliasToken, DerivativeToken } from '../theme/internal'; diff --git a/components/style/motion/fade.ts b/components/style/motion/fade.ts index cb46ca6b3b..547ecf2f5e 100644 --- a/components/style/motion/fade.ts +++ b/components/style/motion/fade.ts @@ -1,5 +1,6 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; + import type { AliasToken } from '../../theme/internal'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import { initMotion } from './motion'; diff --git a/components/style/motion/index.ts b/components/style/motion/index.ts index 2b334b5ee0..837881f1de 100644 --- a/components/style/motion/index.ts +++ b/components/style/motion/index.ts @@ -1,3 +1,4 @@ +import genCollapseMotion from './collapse'; import { fadeIn, fadeOut, initFadeMotion } from './fade'; import { initMoveMotion, @@ -36,7 +37,6 @@ import { zoomUpIn, zoomUpOut, } from './zoom'; -import genCollapseMotion from './collapse'; export { initSlideMotion, diff --git a/components/style/motion/move.ts b/components/style/motion/move.ts index 2953cbac4d..3159f3c79a 100644 --- a/components/style/motion/move.ts +++ b/components/style/motion/move.ts @@ -1,5 +1,6 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; + import type { AliasToken } from '../../theme/internal'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import { initMotion } from './motion'; diff --git a/components/style/motion/slide.ts b/components/style/motion/slide.ts index 600b064c91..c503237f40 100644 --- a/components/style/motion/slide.ts +++ b/components/style/motion/slide.ts @@ -1,5 +1,6 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; + import type { AliasToken } from '../../theme/internal'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import { initMotion } from './motion'; diff --git a/components/style/motion/zoom.ts b/components/style/motion/zoom.ts index 0324446e44..a1a6446d87 100644 --- a/components/style/motion/zoom.ts +++ b/components/style/motion/zoom.ts @@ -1,5 +1,6 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { Keyframes } from '@ant-design/cssinjs'; + import type { AliasToken } from '../../theme/internal'; import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'; import { initMotion } from './motion'; diff --git a/components/style/operationUnit.ts b/components/style/operationUnit.ts index 08029a8cc6..1ba44e897a 100644 --- a/components/style/operationUnit.ts +++ b/components/style/operationUnit.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { DerivativeToken } from '../theme/internal'; // eslint-disable-next-line import/prefer-default-export diff --git a/components/style/roundedArrow.ts b/components/style/roundedArrow.ts index a8931d655c..d8cb725056 100644 --- a/components/style/roundedArrow.ts +++ b/components/style/roundedArrow.ts @@ -1,9 +1,10 @@ /* eslint-disable import/prefer-default-export */ import type { CSSObject } from '@ant-design/cssinjs'; -import type { AliasToken } from '../theme/interface'; import { unit } from '@ant-design/cssinjs'; import type { CSSUtil } from 'antd/es/theme/util/genComponentStyleHook'; +import type { AliasToken } from '../theme/interface'; + export interface ArrowToken { /** @internal */ arrowShadowWidth: number; diff --git a/components/switch/__tests__/index.test.tsx b/components/switch/__tests__/index.test.tsx index 8960d69a02..b5a17273ee 100644 --- a/components/switch/__tests__/index.test.tsx +++ b/components/switch/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Switch from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/switch/__tests__/wave.test.tsx b/components/switch/__tests__/wave.test.tsx index b7f374bfe0..e73f093421 100644 --- a/components/switch/__tests__/wave.test.tsx +++ b/components/switch/__tests__/wave.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import Switch from '..'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; diff --git a/components/switch/demo/text.tsx b/components/switch/demo/text.tsx index 6af99605b4..4f95df69e6 100644 --- a/components/switch/demo/text.tsx +++ b/components/switch/demo/text.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { CheckOutlined, CloseOutlined } from '@ant-design/icons'; -import { Switch, Space } from 'antd'; +import { Space, Switch } from 'antd'; const App: React.FC = () => ( diff --git a/components/switch/style/index.ts b/components/switch/style/index.ts index faed3aad19..1d7c8e40bb 100644 --- a/components/switch/style/index.ts +++ b/components/switch/style/index.ts @@ -1,6 +1,7 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; + import { genFocusStyle, resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/table/ColumnGroup.ts b/components/table/ColumnGroup.ts index c8a730c29c..75e6d405fb 100644 --- a/components/table/ColumnGroup.ts +++ b/components/table/ColumnGroup.ts @@ -1,4 +1,5 @@ import type * as React from 'react'; + import type { ColumnProps } from './Column'; import type { ColumnType } from './interface'; diff --git a/components/table/ExpandIcon.tsx b/components/table/ExpandIcon.tsx index 64c3f79360..c3810ce376 100644 --- a/components/table/ExpandIcon.tsx +++ b/components/table/ExpandIcon.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import type { TableLocale } from './interface'; interface DefaultExpandIconProps { diff --git a/components/table/InternalTable.tsx b/components/table/InternalTable.tsx index 75ff864c83..acc1d37759 100644 --- a/components/table/InternalTable.tsx +++ b/components/table/InternalTable.tsx @@ -1,10 +1,7 @@ import * as React from 'react'; import classNames from 'classnames'; -import { - INTERNAL_HOOKS, - type Reference as RcReference, - type TableProps as RcTableProps, -} from 'rc-table'; +import { INTERNAL_HOOKS } from 'rc-table'; +import type { Reference as RcReference, TableProps as RcTableProps } from 'rc-table'; import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns'; import omit from 'rc-util/lib/omit'; diff --git a/components/table/RcTable/VirtualTable.tsx b/components/table/RcTable/VirtualTable.tsx index 0430f1cc37..465494ba88 100644 --- a/components/table/RcTable/VirtualTable.tsx +++ b/components/table/RcTable/VirtualTable.tsx @@ -1,4 +1,5 @@ import { genVirtualTable } from 'rc-table'; + import type { InternalTableProps } from '../InternalTable'; /** diff --git a/components/table/RcTable/index.tsx b/components/table/RcTable/index.tsx index f845d01fb8..cacafa433f 100644 --- a/components/table/RcTable/index.tsx +++ b/components/table/RcTable/index.tsx @@ -1,4 +1,5 @@ import { genTable } from 'rc-table'; + import type { InternalTableProps } from '../InternalTable'; /** diff --git a/components/table/Table.tsx b/components/table/Table.tsx index f708d72eae..3afb53a60a 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; -import { EXPAND_COLUMN, Summary, type Reference } from 'rc-table'; +import { EXPAND_COLUMN, Summary } from 'rc-table'; +import type { Reference } from 'rc-table'; import type { AnyObject } from '../_util/type'; import Column from './Column'; diff --git a/components/table/__tests__/Table.order.test.tsx b/components/table/__tests__/Table.order.test.tsx index d8cb7ff7fe..782b82a08a 100644 --- a/components/table/__tests__/Table.order.test.tsx +++ b/components/table/__tests__/Table.order.test.tsx @@ -1,8 +1,9 @@ import React from 'react'; + import type { TableProps } from '..'; import Table from '..'; -import { render } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; +import { render } from '../../../tests/utils'; describe('Table.order', () => { window.requestAnimationFrame = (callback) => window.setTimeout(callback, 16); diff --git a/components/table/__tests__/Table.pagination.test.tsx b/components/table/__tests__/Table.pagination.test.tsx index 02cb7725db..e409d2e3c1 100644 --- a/components/table/__tests__/Table.pagination.test.tsx +++ b/components/table/__tests__/Table.pagination.test.tsx @@ -1,12 +1,13 @@ -/* eslint-disable import/first */ -jest.mock('../../_util/scrollTo'); - import React from 'react'; + import type { TablePaginationConfig, TableProps } from '..'; import Table from '..'; -import { act, fireEvent, render } from '../../../tests/utils'; import scrollTo from '../../_util/scrollTo'; import { resetWarned } from '../../_util/warning'; +import { act, fireEvent, render } from '../../../tests/utils'; + +/* eslint-disable import/first */ +jest.mock('../../_util/scrollTo'); describe('Table.pagination', () => { const columns = [ diff --git a/components/table/demo/drag-sorting-handler.tsx b/components/table/demo/drag-sorting-handler.tsx index f946acc372..ddadc8bb47 100644 --- a/components/table/demo/drag-sorting-handler.tsx +++ b/components/table/demo/drag-sorting-handler.tsx @@ -1,3 +1,4 @@ +import React, { useState } from 'react'; import { MenuOutlined } from '@ant-design/icons'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext } from '@dnd-kit/core'; @@ -9,7 +10,6 @@ import { verticalListSortingStrategy, } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import React, { useState } from 'react'; import { Table } from 'antd'; import type { ColumnsType } from 'antd/es/table'; diff --git a/components/table/demo/drag-sorting.tsx b/components/table/demo/drag-sorting.tsx index ffb934cdc8..4e71b96a1f 100644 --- a/components/table/demo/drag-sorting.tsx +++ b/components/table/demo/drag-sorting.tsx @@ -1,14 +1,14 @@ +import React, { useState } from 'react'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'; import { restrictToVerticalAxis } from '@dnd-kit/modifiers'; import { - SortableContext, arrayMove, + SortableContext, useSortable, verticalListSortingStrategy, } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import React, { useState } from 'react'; import { Table } from 'antd'; import type { ColumnsType } from 'antd/es/table'; diff --git a/components/table/demo/hidden-columns.tsx b/components/table/demo/hidden-columns.tsx index 7b1b14a732..6f6f1bfd4b 100644 --- a/components/table/demo/hidden-columns.tsx +++ b/components/table/demo/hidden-columns.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Divider, Table, Checkbox } from 'antd'; +import { Checkbox, Divider, Table } from 'antd'; import type { CheckboxOptionType, TableColumnsType } from 'antd'; interface DataType { diff --git a/components/table/hooks/useFilter/FilterDropdown.tsx b/components/table/hooks/useFilter/FilterDropdown.tsx index 3aa2392b8c..aef5762d00 100644 --- a/components/table/hooks/useFilter/FilterDropdown.tsx +++ b/components/table/hooks/useFilter/FilterDropdown.tsx @@ -11,7 +11,8 @@ import Button from '../../../button'; import type { CheckboxChangeEvent } from '../../../checkbox'; import Checkbox from '../../../checkbox'; import { ConfigContext } from '../../../config-provider/context'; -import Dropdown, { type DropdownProps } from '../../../dropdown'; +import Dropdown from '../../../dropdown'; +import type { DropdownProps } from '../../../dropdown'; import Empty from '../../../empty'; import type { MenuProps } from '../../../menu'; import Menu from '../../../menu'; @@ -455,7 +456,9 @@ function FilterDropdown(props: FilterDropdownProps) { tablePrefixCls={tablePrefixCls} locale={locale} /> - {isEmpty ? empty : ( + {isEmpty ? ( + empty + ) : ( { diff --git a/components/table/hooks/useTitleColumns.ts b/components/table/hooks/useTitleColumns.ts index 4f449b23e4..44b908d10a 100644 --- a/components/table/hooks/useTitleColumns.ts +++ b/components/table/hooks/useTitleColumns.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { ColumnsType, ColumnTitleProps, TransformColumns } from '../interface'; import { renderColumnTitle } from '../util'; diff --git a/components/table/index.ts b/components/table/index.ts index be1d74368e..882b79dee5 100644 --- a/components/table/index.ts +++ b/components/table/index.ts @@ -1,4 +1,4 @@ -import { type TablePaginationConfig, type TableProps } from './InternalTable'; +import type { TablePaginationConfig, TableProps } from './InternalTable'; import Table from './Table'; export type { ColumnProps } from './Column'; diff --git a/components/table/style/bordered.ts b/components/table/style/bordered.ts index 67bacf7758..a69406df01 100644 --- a/components/table/style/bordered.ts +++ b/components/table/style/bordered.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/ellipsis.ts b/components/table/style/ellipsis.ts index 817f9c154b..43b10af397 100644 --- a/components/table/style/ellipsis.ts +++ b/components/table/style/ellipsis.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import { textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/empty.ts b/components/table/style/empty.ts index 843ad73252..63461903f2 100644 --- a/components/table/style/empty.ts +++ b/components/table/style/empty.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/expand.ts b/components/table/style/expand.ts index fc43610742..b9ec44d374 100644 --- a/components/table/style/expand.ts +++ b/components/table/style/expand.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { operationUnit } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/table/style/index.ts b/components/table/style/index.ts index d2d9b76925..c24ff56a75 100644 --- a/components/table/style/index.ts +++ b/components/table/style/index.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; import { clearFix, resetComponent } from '../../style'; diff --git a/components/table/style/pagination.ts b/components/table/style/pagination.ts index 56dca48638..dd8cc6fa02 100644 --- a/components/table/style/pagination.ts +++ b/components/table/style/pagination.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/radius.ts b/components/table/style/radius.ts index 16d6c6fe87..2578fdc0e0 100644 --- a/components/table/style/radius.ts +++ b/components/table/style/radius.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/rtl.ts b/components/table/style/rtl.ts index 6dfe22cee8..e3d7687e42 100644 --- a/components/table/style/rtl.ts +++ b/components/table/style/rtl.ts @@ -1,4 +1,5 @@ import type { CSSObject } from '@ant-design/cssinjs'; + import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/selection.ts b/components/table/style/selection.ts index eeee250036..abab39a4a5 100644 --- a/components/table/style/selection.ts +++ b/components/table/style/selection.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/size.ts b/components/table/style/size.ts index 3c2e1fd876..5f394b933e 100644 --- a/components/table/style/size.ts +++ b/components/table/style/size.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/sticky.ts b/components/table/style/sticky.ts index 2bbe8ac744..f11c55438e 100644 --- a/components/table/style/sticky.ts +++ b/components/table/style/sticky.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/summary.ts b/components/table/style/summary.ts index ebcc06ed78..478bdacf56 100644 --- a/components/table/style/summary.ts +++ b/components/table/style/summary.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/table/style/virtual.ts b/components/table/style/virtual.ts index fcb903c2c4..61c2e659d4 100644 --- a/components/table/style/virtual.ts +++ b/components/table/style/virtual.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import type { GenerateStyle } from '../../theme/internal'; import type { TableToken } from './index'; diff --git a/components/tabs/demo/animated.tsx b/components/tabs/demo/animated.tsx index fc1fd3cff3..261b47f1a2 100644 --- a/components/tabs/demo/animated.tsx +++ b/components/tabs/demo/animated.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Tabs, Switch, Space } from 'antd'; +import { Space, Switch, Tabs } from 'antd'; const App: React.FC = () => { const [inkBar, setInkBar] = React.useState(true); diff --git a/components/tabs/demo/card-top.tsx b/components/tabs/demo/card-top.tsx index b6d0f69009..6c4f9e3e4c 100644 --- a/components/tabs/demo/card-top.tsx +++ b/components/tabs/demo/card-top.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { createStyles } from 'antd-style'; import { Tabs } from 'antd'; +import { createStyles } from 'antd-style'; const useStyle = createStyles(({ token, css }) => { const antdTabsCls = '.ant-tabs'; diff --git a/components/tabs/demo/custom-tab-bar-node.tsx b/components/tabs/demo/custom-tab-bar-node.tsx index b28bacd05e..1f87c75871 100644 --- a/components/tabs/demo/custom-tab-bar-node.tsx +++ b/components/tabs/demo/custom-tab-bar-node.tsx @@ -1,3 +1,4 @@ +import React, { useState } from 'react'; import type { DragEndEvent } from '@dnd-kit/core'; import { DndContext, PointerSensor, useSensor } from '@dnd-kit/core'; import { @@ -7,7 +8,6 @@ import { useSortable, } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import React, { useState } from 'react'; import { Tabs } from 'antd'; interface DraggableTabPaneProps extends React.HTMLAttributes { diff --git a/components/tabs/hooks/useAnimateConfig.ts b/components/tabs/hooks/useAnimateConfig.ts index 7af05e990b..52c4ed2bbe 100644 --- a/components/tabs/hooks/useAnimateConfig.ts +++ b/components/tabs/hooks/useAnimateConfig.ts @@ -1,5 +1,6 @@ import type { CSSMotionProps } from 'rc-motion'; import type { AnimatedConfig } from 'rc-tabs/lib/interface'; + import type { TabsProps } from '..'; import { getTransitionName } from '../../_util/motion'; diff --git a/components/tabs/style/index.ts b/components/tabs/style/index.ts index 7417e4e351..b88be98550 100644 --- a/components/tabs/style/index.ts +++ b/components/tabs/style/index.ts @@ -1,4 +1,5 @@ -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; import { genFocusStyle, resetComponent, textEllipsis } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; diff --git a/components/tag/style/index.ts b/components/tag/style/index.ts index 4165b0abe9..6ed59cc631 100644 --- a/components/tag/style/index.ts +++ b/components/tag/style/index.ts @@ -1,5 +1,6 @@ import type React from 'react'; -import { unit, type CSSInterpolation } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSInterpolation } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; import { resetComponent } from '../../style'; diff --git a/components/tag/style/presetCmp.ts b/components/tag/style/presetCmp.ts index e6cc417154..a2ec38803b 100644 --- a/components/tag/style/presetCmp.ts +++ b/components/tag/style/presetCmp.ts @@ -1,5 +1,6 @@ // Style as status component -import { prepareComponentToken, prepareToken, type TagToken } from '.'; +import { prepareComponentToken, prepareToken } from '.'; +import type { TagToken } from '.'; import { genPresetColor, genSubStyleComponent } from '../../theme/internal'; // ============================== Preset ============================== diff --git a/components/tag/style/statusCmp.ts b/components/tag/style/statusCmp.ts index 7102e45fdc..d4dadcc158 100644 --- a/components/tag/style/statusCmp.ts +++ b/components/tag/style/statusCmp.ts @@ -1,7 +1,8 @@ // Style as status component import type { CSSInterpolation } from '@ant-design/cssinjs'; -import { prepareComponentToken, prepareToken, type TagToken } from '.'; +import { prepareComponentToken, prepareToken } from '.'; +import type { TagToken } from '.'; import capitalize from '../../_util/capitalize'; import { genSubStyleComponent } from '../../theme/internal'; diff --git a/components/theme/__tests__/token.test.tsx b/components/theme/__tests__/token.test.tsx index b6900f1e2d..ed83098a7f 100644 --- a/components/theme/__tests__/token.test.tsx +++ b/components/theme/__tests__/token.test.tsx @@ -1,6 +1,7 @@ -import { Theme } from '@ant-design/cssinjs'; import * as React from 'react'; +import { Theme } from '@ant-design/cssinjs'; import { Input } from 'antd'; + import theme from '..'; import { render, renderHook } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; diff --git a/components/theme/__tests__/util.test.tsx b/components/theme/__tests__/util.test.tsx index 7912995579..722ea95211 100644 --- a/components/theme/__tests__/util.test.tsx +++ b/components/theme/__tests__/util.test.tsx @@ -1,6 +1,6 @@ -import getAlphaColor from '../util/getAlphaColor'; import genCalc from '../util/calc'; import type AbstractCalculator from '../util/calc/calculator'; +import getAlphaColor from '../util/getAlphaColor'; import genMaxMin from '../util/maxmin'; describe('util', () => { diff --git a/components/theme/interface/alias.ts b/components/theme/interface/alias.ts index 159661dc99..180a09d892 100644 --- a/components/theme/interface/alias.ts +++ b/components/theme/interface/alias.ts @@ -1,4 +1,5 @@ import type * as React from 'react'; + import type { MapToken } from './maps'; // ====================================================================== diff --git a/components/theme/internal.ts b/components/theme/internal.ts index 62c74f30b0..4526f62dca 100644 --- a/components/theme/internal.ts +++ b/components/theme/internal.ts @@ -9,17 +9,17 @@ import type { UseComponentStyleResult, } from './interface'; import { PresetColors } from './interface'; +import { getLineHeight } from './themes/shared/genFontSizes'; import useToken from './useToken'; +import calc from './util/calc'; import type { FullToken, GetDefaultToken } from './util/genComponentStyleHook'; import genComponentStyleHook, { - genSubStyleComponent, genStyleHooks, + genSubStyleComponent, } from './util/genComponentStyleHook'; import genPresetColor from './util/genPresetColor'; import statisticToken, { merge as mergeToken } from './util/statistic'; import useResetIconStyle from './util/useResetIconStyle'; -import calc from './util/calc'; -import { getLineHeight } from './themes/shared/genFontSizes'; export { DesignTokenContext, defaultConfig } from './context'; export { diff --git a/components/theme/themes/compact/index.ts b/components/theme/themes/compact/index.ts index 0af9ef51c7..f26f0e778f 100644 --- a/components/theme/themes/compact/index.ts +++ b/components/theme/themes/compact/index.ts @@ -1,9 +1,10 @@ import type { DerivativeFunc } from '@ant-design/cssinjs'; -import genControlHeight from '../shared/genControlHeight'; + import type { MapToken, SeedToken } from '../../interface'; import defaultAlgorithm from '../default'; -import genCompactSizeMapToken from './genCompactSizeMapToken'; +import genControlHeight from '../shared/genControlHeight'; import genFontMapToken from '../shared/genFontMapToken'; +import genCompactSizeMapToken from './genCompactSizeMapToken'; const derivative: DerivativeFunc = (token, mapToken) => { const mergedMapToken = mapToken ?? defaultAlgorithm(token); diff --git a/components/theme/themes/default/colors.ts b/components/theme/themes/default/colors.ts index d0e684dd49..25e48ad46e 100644 --- a/components/theme/themes/default/colors.ts +++ b/components/theme/themes/default/colors.ts @@ -1,4 +1,5 @@ import { generate } from '@ant-design/colors'; + import type { GenerateColorMap, GenerateNeutralColorMap } from '../ColorMap'; import { getAlphaColor, getSolidColor } from './colorAlgorithm'; diff --git a/components/theme/themes/shared/genColorMapToken.ts b/components/theme/themes/shared/genColorMapToken.ts index 3a3aa8d6db..df18501f8d 100644 --- a/components/theme/themes/shared/genColorMapToken.ts +++ b/components/theme/themes/shared/genColorMapToken.ts @@ -1,4 +1,5 @@ import { TinyColor } from '@ctrl/tinycolor'; + import type { ColorMapToken, SeedToken } from '../../interface'; import type { GenerateColorMap, GenerateNeutralColorMap } from '../ColorMap'; diff --git a/components/theme/util/alias.ts b/components/theme/util/alias.ts index c1c231901f..e20637897e 100644 --- a/components/theme/util/alias.ts +++ b/components/theme/util/alias.ts @@ -1,4 +1,5 @@ import { TinyColor } from '@ctrl/tinycolor'; + import type { AliasToken, MapToken, OverrideToken, SeedToken } from '../interface'; import seedToken from '../themes/seed'; import getAlphaColor from './getAlphaColor'; diff --git a/components/theme/util/calc/index.ts b/components/theme/util/calc/index.ts index 1a1286d20b..f7fbf24f95 100644 --- a/components/theme/util/calc/index.ts +++ b/components/theme/util/calc/index.ts @@ -1,6 +1,6 @@ -import NumCalculator from './NumCalculator'; -import CSSCalculator from './CSSCalculator'; import type AbstractCalculator from './calculator'; +import CSSCalculator from './CSSCalculator'; +import NumCalculator from './NumCalculator'; const genCalc = (type: 'css' | 'js') => { const Calculator = type === 'css' ? CSSCalculator : NumCalculator; diff --git a/components/theme/util/genPresetColor.ts b/components/theme/util/genPresetColor.ts index eb6a3e22e7..b4d96116b0 100644 --- a/components/theme/util/genPresetColor.ts +++ b/components/theme/util/genPresetColor.ts @@ -1,7 +1,8 @@ /* eslint-disable import/prefer-default-export */ import type { CSSObject } from '@ant-design/cssinjs'; -import type { AliasToken, PresetColorKey } from '../internal'; + import { PresetColors } from '../interface'; +import type { AliasToken, PresetColorKey } from '../internal'; import type { TokenWithCommonCls } from './genComponentStyleHook'; interface CalcColor { diff --git a/components/theme/util/useResetIconStyle.ts b/components/theme/util/useResetIconStyle.ts index f31204f49b..47ee6557e3 100644 --- a/components/theme/util/useResetIconStyle.ts +++ b/components/theme/util/useResetIconStyle.ts @@ -1,6 +1,7 @@ import { useStyleRegister } from '@ant-design/cssinjs'; -import { resetIcon } from '../../style'; + import type { CSPConfig } from '../../config-provider'; +import { resetIcon } from '../../style'; import useToken from '../useToken'; const useResetIconStyle = (iconPrefixCls: string, csp?: CSPConfig) => { diff --git a/components/time-picker/__tests__/demo.test.tsx b/components/time-picker/__tests__/demo.test.tsx index b56475e4c6..159e9d2561 100644 --- a/components/time-picker/__tests__/demo.test.tsx +++ b/components/time-picker/__tests__/demo.test.tsx @@ -1,5 +1,6 @@ -import dayjs from 'dayjs'; import * as React from 'react'; +import dayjs from 'dayjs'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('time-picker', { diff --git a/components/time-picker/__tests__/index.test.tsx b/components/time-picker/__tests__/index.test.tsx index 362dc69e43..d95c926b2f 100644 --- a/components/time-picker/__tests__/index.test.tsx +++ b/components/time-picker/__tests__/index.test.tsx @@ -1,12 +1,13 @@ +import React from 'react'; import dayjs from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; -import React from 'react'; + import TimePicker from '..'; +import { resetWarned } from '../../_util/warning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; dayjs.extend(customParseFormat); diff --git a/components/time-picker/__tests__/legacy.test.tsx b/components/time-picker/__tests__/legacy.test.tsx index 5a341818aa..3296893e5c 100644 --- a/components/time-picker/__tests__/legacy.test.tsx +++ b/components/time-picker/__tests__/legacy.test.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import dayjs, { type Dayjs } from 'dayjs'; +import dayjs from 'dayjs'; +import type { Dayjs } from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; import TimePicker from '..'; diff --git a/components/time-picker/__tests__/type.test.tsx b/components/time-picker/__tests__/type.test.tsx index 92cdb9ce38..d434396058 100644 --- a/components/time-picker/__tests__/type.test.tsx +++ b/components/time-picker/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import TimePicker from '..'; describe('TimePicker.typescript', () => { diff --git a/components/time-picker/demo/disabled.tsx b/components/time-picker/demo/disabled.tsx index 333983b8d0..f0c894ec39 100644 --- a/components/time-picker/demo/disabled.tsx +++ b/components/time-picker/demo/disabled.tsx @@ -1,7 +1,7 @@ import React from 'react'; +import { TimePicker } from 'antd'; import dayjs from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; -import { TimePicker } from 'antd'; dayjs.extend(customParseFormat); diff --git a/components/time-picker/demo/hide-column.tsx b/components/time-picker/demo/hide-column.tsx index 22c44646b7..9ef30ea59b 100644 --- a/components/time-picker/demo/hide-column.tsx +++ b/components/time-picker/demo/hide-column.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import dayjs from 'dayjs'; import { TimePicker } from 'antd'; +import dayjs from 'dayjs'; const format = 'HH:mm'; diff --git a/components/time-picker/demo/size.tsx b/components/time-picker/demo/size.tsx index 4008ccdf52..63ded5d74e 100644 --- a/components/time-picker/demo/size.tsx +++ b/components/time-picker/demo/size.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import dayjs from 'dayjs'; import { Space, TimePicker } from 'antd'; +import dayjs from 'dayjs'; const App: React.FC = () => ( diff --git a/components/time-picker/demo/value.tsx b/components/time-picker/demo/value.tsx index e57dcde998..5c31cf15a3 100644 --- a/components/time-picker/demo/value.tsx +++ b/components/time-picker/demo/value.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import type { Dayjs } from 'dayjs'; import { TimePicker } from 'antd'; +import type { Dayjs } from 'dayjs'; const App: React.FC = () => { const [value, setValue] = useState(null); diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index f4becfdb0d..f7a79949f6 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -3,9 +3,9 @@ import classNames from 'classnames'; import { devUseWarning } from '../_util/warning'; import { ConfigContext } from '../config-provider'; +import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; // CSSINJS import useStyle from './style'; -import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import type { TimelineItemProps } from './TimelineItem'; import TimelineItem from './TimelineItem'; import TimelineItemList from './TimelineItemList'; diff --git a/components/timeline/TimelineItem.tsx b/components/timeline/TimelineItem.tsx index 8e78b14d69..fa83207e0c 100644 --- a/components/timeline/TimelineItem.tsx +++ b/components/timeline/TimelineItem.tsx @@ -1,5 +1,6 @@ -import classNames from 'classnames'; import * as React from 'react'; +import classNames from 'classnames'; + import type { LiteralUnion } from '../_util/type'; import { ConfigContext } from '../config-provider'; diff --git a/components/timeline/TimelineItemList.tsx b/components/timeline/TimelineItemList.tsx index d31ad82243..c7f7ef555d 100644 --- a/components/timeline/TimelineItemList.tsx +++ b/components/timeline/TimelineItemList.tsx @@ -1,8 +1,9 @@ -import classNames from 'classnames'; import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; -import TimelineItem from './TimelineItem'; +import classNames from 'classnames'; + import type { TimelineProps } from './Timeline'; +import TimelineItem from './TimelineItem'; import type { TimelineItemProps } from './TimelineItem'; const TimelineItemList: React.FC = ({ diff --git a/components/timeline/__tests__/index.test.tsx b/components/timeline/__tests__/index.test.tsx index 308b55a171..c5bfa6c72f 100644 --- a/components/timeline/__tests__/index.test.tsx +++ b/components/timeline/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { TimelineProps } from '..'; import TimeLine from '..'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/timeline/style/index.ts b/components/timeline/style/index.ts index fdb8a87ecf..822feff4d3 100644 --- a/components/timeline/style/index.ts +++ b/components/timeline/style/index.ts @@ -1,5 +1,6 @@ import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/tooltip/PurePanel.tsx b/components/tooltip/PurePanel.tsx index 6687767e6d..5dc5e6e7d0 100644 --- a/components/tooltip/PurePanel.tsx +++ b/components/tooltip/PurePanel.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import classNames from 'classnames'; import { Popup } from 'rc-tooltip'; -import * as React from 'react'; + import type { TooltipProps } from '.'; import { ConfigContext } from '../config-provider'; import useStyle from './style'; diff --git a/components/tooltip/__tests__/demo.test.tsx b/components/tooltip/__tests__/demo.test.tsx index 72468220d9..65991fde90 100644 --- a/components/tooltip/__tests__/demo.test.tsx +++ b/components/tooltip/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tooltip', { diff --git a/components/tooltip/__tests__/tooltip.test.tsx b/components/tooltip/__tests__/tooltip.test.tsx index a1c045fd88..ff97799b81 100644 --- a/components/tooltip/__tests__/tooltip.test.tsx +++ b/components/tooltip/__tests__/tooltip.test.tsx @@ -1,13 +1,14 @@ -import { spyElementPrototype } from 'rc-util/lib/test/domHook'; import React from 'react'; +import { spyElementPrototype } from 'rc-util/lib/test/domHook'; import { act } from 'react-dom/test-utils'; + import type { TooltipPlacement } from '..'; import Tooltip from '..'; +import getPlacements from '../../_util/placements'; +import { resetWarned } from '../../_util/warning'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render, waitFakeTimer } from '../../../tests/utils'; -import getPlacements from '../../_util/placements'; -import { resetWarned } from '../../_util/warning'; import Button from '../../button'; import DatePicker from '../../date-picker'; import Input from '../../input'; diff --git a/components/tooltip/__tests__/type.test.tsx b/components/tooltip/__tests__/type.test.tsx index e1be478ff3..d80b8a7a4c 100644 --- a/components/tooltip/__tests__/type.test.tsx +++ b/components/tooltip/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Tooltip from '..'; describe('Tooltip.typescript', () => { diff --git a/components/tooltip/demo/disabled-children.tsx b/components/tooltip/demo/disabled-children.tsx index 2d63d5c09c..976e52e54c 100644 --- a/components/tooltip/demo/disabled-children.tsx +++ b/components/tooltip/demo/disabled-children.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Checkbox, Input, Select, Space, Tooltip, InputNumber } from 'antd'; +import { Button, Checkbox, Input, InputNumber, Select, Space, Tooltip } from 'antd'; const WrapperTooltip: React.FC<{ children?: React.ReactNode }> = (props) => ( diff --git a/components/tooltip/demo/disabled.tsx b/components/tooltip/demo/disabled.tsx index da07150cdd..5677005fa8 100644 --- a/components/tooltip/demo/disabled.tsx +++ b/components/tooltip/demo/disabled.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Space, Button, Tooltip } from 'antd'; +import { Button, Space, Tooltip } from 'antd'; const App: React.FC = () => { const [disabled, setDisabled] = useState(true); diff --git a/components/tooltip/demo/placement.tsx b/components/tooltip/demo/placement.tsx index d865495cca..cd06365602 100644 --- a/components/tooltip/demo/placement.tsx +++ b/components/tooltip/demo/placement.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Tooltip, ConfigProvider } from 'antd'; +import { Button, ConfigProvider, Tooltip } from 'antd'; const text = prompt text; diff --git a/components/tooltip/style/index.ts b/components/tooltip/style/index.ts index d5a956ad2e..7063b2d253 100644 --- a/components/tooltip/style/index.ts +++ b/components/tooltip/style/index.ts @@ -1,3 +1,5 @@ +import { unit } from '@ant-design/cssinjs'; + import { resetComponent } from '../../style'; import { initZoomMotion } from '../../style/motion'; import type { ArrowOffsetToken } from '../../style/placementArrow'; @@ -5,11 +7,10 @@ import getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS, } from '../../style/placementArrow'; -import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; -import { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; import type { ArrowToken } from '../../style/roundedArrow'; import { getArrowToken } from '../../style/roundedArrow'; +import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; +import { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal'; export interface ComponentToken extends ArrowOffsetToken, ArrowToken { /** diff --git a/components/tooltip/util.ts b/components/tooltip/util.ts index 7fa1f65b2e..8045bf4726 100644 --- a/components/tooltip/util.ts +++ b/components/tooltip/util.ts @@ -2,6 +2,7 @@ import type * as React from 'react'; import classNames from 'classnames'; + import { isPresetColor } from '../_util/colors'; export function parseColor(prefixCls: string, color?: string) { diff --git a/components/tour/__tests__/demo.test.tsx b/components/tour/__tests__/demo.test.tsx index 31d55a5d58..8480a8480e 100644 --- a/components/tour/__tests__/demo.test.tsx +++ b/components/tour/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tour', { diff --git a/components/tour/demo/indicator.tsx b/components/tour/demo/indicator.tsx index ff11b869ba..734df98a3c 100644 --- a/components/tour/demo/indicator.tsx +++ b/components/tour/demo/indicator.tsx @@ -1,5 +1,5 @@ -import { EllipsisOutlined } from '@ant-design/icons'; import React, { useRef, useState } from 'react'; +import { EllipsisOutlined } from '@ant-design/icons'; import type { TourProps } from 'antd'; import { Button, Divider, Space, Tour } from 'antd'; diff --git a/components/tour/index.tsx b/components/tour/index.tsx index ebbab4c056..8b16000f47 100644 --- a/components/tour/index.tsx +++ b/components/tour/index.tsx @@ -1,5 +1,6 @@ import React, { useContext } from 'react'; -import RCTour, { type TourProps as RcTourProps } from '@rc-component/tour'; +import RCTour from '@rc-component/tour'; +import type { TourProps as RcTourProps } from '@rc-component/tour'; import classNames from 'classnames'; import { useZIndex } from '../_util/hooks/useZIndex'; diff --git a/components/tour/style/index.ts b/components/tour/style/index.ts index 6311267a47..43695a3db3 100644 --- a/components/tour/style/index.ts +++ b/components/tour/style/index.ts @@ -1,16 +1,16 @@ +import { unit } from '@ant-design/cssinjs'; import { TinyColor } from '@ctrl/tinycolor'; -import { resetComponent, genFocusStyle } from '../../style'; +import { genFocusStyle, resetComponent } from '../../style'; import type { ArrowOffsetToken } from '../../style/placementArrow'; import getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS, } from '../../style/placementArrow'; -import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; -import { genStyleHooks, mergeToken } from '../../theme/internal'; import type { ArrowToken } from '../../style/roundedArrow'; import { getArrowToken } from '../../style/roundedArrow'; -import { unit } from '@ant-design/cssinjs'; +import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; +import { genStyleHooks, mergeToken } from '../../theme/internal'; export interface ComponentToken extends ArrowOffsetToken, ArrowToken { /** diff --git a/components/transfer/ListItem.tsx b/components/transfer/ListItem.tsx index ff76ed552d..8b870364a0 100644 --- a/components/transfer/ListItem.tsx +++ b/components/transfer/ListItem.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import classNames from 'classnames'; -import * as React from 'react'; + import type { KeyWiseTransferItem } from '.'; import TransButton from '../_util/transButton'; import Checkbox from '../checkbox'; diff --git a/components/transfer/__tests__/customize.test.tsx b/components/transfer/__tests__/customize.test.tsx index eefa25f138..a0f061f8fe 100644 --- a/components/transfer/__tests__/customize.test.tsx +++ b/components/transfer/__tests__/customize.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { render } from '../../../tests/utils'; import type { TransferProps } from '../index'; import Transfer from '../index'; diff --git a/components/transfer/__tests__/search.test.tsx b/components/transfer/__tests__/search.test.tsx index 1736844f07..4537166595 100644 --- a/components/transfer/__tests__/search.test.tsx +++ b/components/transfer/__tests__/search.test.tsx @@ -1,5 +1,6 @@ -import { render as testLibRender } from '@testing-library/react'; import React from 'react'; +import { render as testLibRender } from '@testing-library/react'; + import { fireEvent, render } from '../../../tests/utils'; import Transfer from '../index'; import Search from '../search'; diff --git a/components/transfer/hooks/useSelection.ts b/components/transfer/hooks/useSelection.ts index 5973c2b394..7868bb1995 100644 --- a/components/transfer/hooks/useSelection.ts +++ b/components/transfer/hooks/useSelection.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { TransferKey } from '../interface'; const EMPTY_KEYS: TransferKey[] = []; diff --git a/components/transfer/operation.tsx b/components/transfer/operation.tsx index d8df7ee31e..5cd92ab3ba 100644 --- a/components/transfer/operation.tsx +++ b/components/transfer/operation.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import LeftOutlined from '@ant-design/icons/LeftOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; -import * as React from 'react'; + import Button from '../button'; import type { DirectionType } from '../config-provider'; diff --git a/components/transfer/search.tsx b/components/transfer/search.tsx index e5cec43be5..3a3bbe6969 100644 --- a/components/transfer/search.tsx +++ b/components/transfer/search.tsx @@ -1,5 +1,5 @@ -import SearchOutlined from '@ant-design/icons/SearchOutlined'; import * as React from 'react'; +import SearchOutlined from '@ant-design/icons/SearchOutlined'; import Input from '../input'; diff --git a/components/transfer/style/index.ts b/components/transfer/style/index.ts index f01f04789f..81cee62c32 100644 --- a/components/transfer/style/index.ts +++ b/components/transfer/style/index.ts @@ -1,4 +1,6 @@ -import { type CSSObject, unit } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import { resetComponent, resetIcon, textEllipsis } from '../../style'; import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; diff --git a/components/tree-select/__tests__/demo.test.tsx b/components/tree-select/__tests__/demo.test.tsx index 65cda3e273..502e159bf1 100644 --- a/components/tree-select/__tests__/demo.test.tsx +++ b/components/tree-select/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('tree-select', { diff --git a/components/tree-select/__tests__/index.test.tsx b/components/tree-select/__tests__/index.test.tsx index 3c0a879277..cc00bc5134 100644 --- a/components/tree-select/__tests__/index.test.tsx +++ b/components/tree-select/__tests__/index.test.tsx @@ -1,10 +1,11 @@ import React from 'react'; + import TreeSelect, { TreeNode } from '..'; +import { resetWarned } from '../../_util/warning'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { render } from '../../../tests/utils'; -import { resetWarned } from '../../_util/warning'; describe('TreeSelect', () => { focusTest(TreeSelect, { refFocus: true }); diff --git a/components/tree-select/style/index.ts b/components/tree-select/style/index.ts index 7cb1e82880..c4a7bfa024 100644 --- a/components/tree-select/style/index.ts +++ b/components/tree-select/style/index.ts @@ -1,10 +1,11 @@ import { unit } from '@ant-design/cssinjs'; + import { getStyle as getCheckboxStyle } from '../../checkbox/style'; import type { AliasToken, FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; +import type { CSSUtil } from '../../theme/util/genComponentStyleHook'; import type { TreeSharedToken } from '../../tree/style'; import { genTreeStyle, initComponentToken } from '../../tree/style'; -import type { CSSUtil } from '../../theme/util/genComponentStyleHook'; export interface ComponentToken extends TreeSharedToken {} diff --git a/components/tree/__tests__/index.test.tsx b/components/tree/__tests__/index.test.tsx index 1daf31ab63..12678506f3 100644 --- a/components/tree/__tests__/index.test.tsx +++ b/components/tree/__tests__/index.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; + import { render, screen } from '../../../tests/utils'; -import type { AntTreeNodeProps } from '../Tree'; import Tree from '../index'; +import type { AntTreeNodeProps } from '../Tree'; const { TreeNode } = Tree; diff --git a/components/tree/__tests__/type.test.tsx b/components/tree/__tests__/type.test.tsx index 3d277b7821..b08408b817 100644 --- a/components/tree/__tests__/type.test.tsx +++ b/components/tree/__tests__/type.test.tsx @@ -1,5 +1,6 @@ -import type { BasicDataNode } from 'rc-tree'; import * as React from 'react'; +import type { BasicDataNode } from 'rc-tree'; + import { render } from '../../../tests/utils'; import type { DataNode } from '../index'; import Tree from '../index'; diff --git a/components/tree/__tests__/util.test.tsx b/components/tree/__tests__/util.test.tsx index 81b7947281..c2ff9ab773 100644 --- a/components/tree/__tests__/util.test.tsx +++ b/components/tree/__tests__/util.test.tsx @@ -1,5 +1,6 @@ -import { render, screen } from '@testing-library/react'; import React from 'react'; +import { render, screen } from '@testing-library/react'; + import { calcRangeKeys } from '../utils/dictUtil'; import SwitcherIconCom from '../utils/iconUtil'; diff --git a/components/tree/style/index.ts b/components/tree/style/index.ts index 214e19fae3..edf399bb47 100644 --- a/components/tree/style/index.ts +++ b/components/tree/style/index.ts @@ -1,5 +1,6 @@ import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs'; import { Keyframes, unit } from '@ant-design/cssinjs'; + import { getStyle as getCheckboxStyle } from '../../checkbox/style'; import { genFocusOutline, resetComponent } from '../../style'; import { genCollapseMotion } from '../../style/motion'; diff --git a/components/typography/Base/CopyBtn.tsx b/components/typography/Base/CopyBtn.tsx index af8f6e4aa9..6269dca261 100644 --- a/components/typography/Base/CopyBtn.tsx +++ b/components/typography/Base/CopyBtn.tsx @@ -1,12 +1,12 @@ import * as React from 'react'; -import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CopyOutlined from '@ant-design/icons/CopyOutlined'; +import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import type { CopyConfig } from '.'; import TransButton from '../../_util/transButton'; -import { type Locale } from '../../locale'; +import type { Locale } from '../../locale'; import Tooltip from '../../tooltip'; import { getNode, toList } from './util'; diff --git a/components/typography/Base/EllipsisTooltip.tsx b/components/typography/Base/EllipsisTooltip.tsx index c4721a8d3a..886d53618e 100644 --- a/components/typography/Base/EllipsisTooltip.tsx +++ b/components/typography/Base/EllipsisTooltip.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import Tooltip from '../../tooltip'; import type { TooltipProps } from '../../tooltip'; diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 08e699c6ba..c8a889a27f 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -1,8 +1,9 @@ +import * as React from 'react'; import EnterOutlined from '@ant-design/icons/EnterOutlined'; import classNames from 'classnames'; import type { AutoSizeType } from 'rc-textarea'; import KeyCode from 'rc-util/lib/KeyCode'; -import * as React from 'react'; + import { cloneElement } from '../_util/reactNode'; import type { DirectionType } from '../config-provider'; import type { TextAreaRef } from '../input/TextArea'; diff --git a/components/typography/Paragraph.tsx b/components/typography/Paragraph.tsx index 81ae66831a..2911e90fff 100644 --- a/components/typography/Paragraph.tsx +++ b/components/typography/Paragraph.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import type { BlockProps } from './Base'; import Base from './Base'; diff --git a/components/typography/Title.tsx b/components/typography/Title.tsx index b58f13a6e9..6eb8cdd068 100644 --- a/components/typography/Title.tsx +++ b/components/typography/Title.tsx @@ -12,7 +12,7 @@ export interface TitleProps React.HTMLAttributes, 'type' | keyof BlockProps<'h1' | 'h2' | 'h3' | 'h4' | 'h5'> > { - level?: typeof TITLE_ELE_LIST[number]; + level?: (typeof TITLE_ELE_LIST)[number]; } const Title = React.forwardRef((props, ref) => { diff --git a/components/typography/__tests__/demo.test.tsx b/components/typography/__tests__/demo.test.tsx index b4ed9129ce..fd645ae583 100644 --- a/components/typography/__tests__/demo.test.tsx +++ b/components/typography/__tests__/demo.test.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest'; demoTest('typography'); diff --git a/components/typography/__tests__/enter-key-callback.test.tsx b/components/typography/__tests__/enter-key-callback.test.tsx index eeb5a2a8cb..3542a6d894 100644 --- a/components/typography/__tests__/enter-key-callback.test.tsx +++ b/components/typography/__tests__/enter-key-callback.test.tsx @@ -1,5 +1,6 @@ -import KeyCode from 'rc-util/lib/KeyCode'; import React from 'react'; +import KeyCode from 'rc-util/lib/KeyCode'; + import { fireEvent, render } from '../../../tests/utils'; import Paragraph from '../Paragraph'; diff --git a/components/typography/__tests__/prefixCls.test.tsx b/components/typography/__tests__/prefixCls.test.tsx index 5ab0c0dfa6..2da040b359 100644 --- a/components/typography/__tests__/prefixCls.test.tsx +++ b/components/typography/__tests__/prefixCls.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { render } from '../../../tests/utils'; +import { render } from '../../../tests/utils'; import Base from '../Base'; describe('Typography keep prefixCls', () => { diff --git a/components/typography/demo/editable.tsx b/components/typography/demo/editable.tsx index 319ae2da5c..bab078fdf2 100644 --- a/components/typography/demo/editable.tsx +++ b/components/typography/demo/editable.tsx @@ -1,4 +1,4 @@ -import React, { useState, useMemo } from 'react'; +import React, { useMemo, useState } from 'react'; import { CheckOutlined, HighlightOutlined } from '@ant-design/icons'; import { Radio, Typography } from 'antd'; diff --git a/components/typography/style/mixins.ts b/components/typography/style/mixins.ts index 4e08fa7e77..f4614c9f63 100644 --- a/components/typography/style/mixins.ts +++ b/components/typography/style/mixins.ts @@ -1,14 +1,16 @@ /* .typography-title(@fontSize; @fontWeight; @lineHeight; @headingColor; @headingMarginBottom;) { - margin-bottom: @headingMarginBottom; - color: @headingColor; - font-weight: @fontWeight; - fontSize: @fontSize; - line-height: @lineHeight; + margin-bottom: @headingMarginBottom; + color: @headingColor; + font-weight: @fontWeight; + fontSize: @fontSize; + line-height: @lineHeight; } */ import { gold } from '@ant-design/colors'; -import { unit, type CSSObject } from '@ant-design/cssinjs'; +import { unit } from '@ant-design/cssinjs'; +import type { CSSObject } from '@ant-design/cssinjs'; + import type { TypographyToken } from '.'; import { operationUnit } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/upload/Dragger.tsx b/components/upload/Dragger.tsx index f4b909f2e9..b69bd2bdb0 100644 --- a/components/upload/Dragger.tsx +++ b/components/upload/Dragger.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; + +import type { UploadProps } from './interface'; import type { UploadRef } from './Upload'; import Upload from './Upload'; -import type { UploadProps } from './interface'; export type DraggerProps = UploadProps & { height?: number }; diff --git a/components/upload/__tests__/dragger.test.tsx b/components/upload/__tests__/dragger.test.tsx index ebdcc37d51..ac66ef92fe 100644 --- a/components/upload/__tests__/dragger.test.tsx +++ b/components/upload/__tests__/dragger.test.tsx @@ -1,5 +1,6 @@ /* eslint-disable react/no-string-refs, react/prefer-es6-class */ import React from 'react'; + import Upload from '..'; import mountTest from '../../../tests/shared/mountTest'; import { act, fireEvent, render, waitFor } from '../../../tests/utils'; diff --git a/components/upload/__tests__/type.test.tsx b/components/upload/__tests__/type.test.tsx index 5d74aa0643..e2bcb83fc7 100644 --- a/components/upload/__tests__/type.test.tsx +++ b/components/upload/__tests__/type.test.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import type { UploadProps } from '..'; import Upload from '..'; diff --git a/components/upload/demo/component-token.tsx b/components/upload/demo/component-token.tsx index 4026a9c072..eb33e89bf5 100644 --- a/components/upload/demo/component-token.tsx +++ b/components/upload/demo/component-token.tsx @@ -1,5 +1,5 @@ -import { UploadOutlined } from '@ant-design/icons'; import React from 'react'; +import { UploadOutlined } from '@ant-design/icons'; import type { UploadProps } from 'antd'; import { Button, ConfigProvider, Upload } from 'antd'; diff --git a/components/upload/style/dragger.ts b/components/upload/style/dragger.ts index 77c4d69c32..2a89a22166 100644 --- a/components/upload/style/dragger.ts +++ b/components/upload/style/dragger.ts @@ -1,4 +1,5 @@ import { unit } from '@ant-design/cssinjs'; + import type { UploadToken } from '.'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/upload/style/list.ts b/components/upload/style/list.ts index bad53a0a8b..03b9b47775 100644 --- a/components/upload/style/list.ts +++ b/components/upload/style/list.ts @@ -1,4 +1,5 @@ import { unit } from '@ant-design/cssinjs'; + import type { UploadToken } from '.'; import { clearFix, textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; diff --git a/components/upload/style/motion.ts b/components/upload/style/motion.ts index 86a5a0ad71..e3629a5d4f 100644 --- a/components/upload/style/motion.ts +++ b/components/upload/style/motion.ts @@ -1,7 +1,8 @@ import { Keyframes } from '@ant-design/cssinjs'; + import type { UploadToken } from '.'; -import type { GenerateStyle } from '../../theme/internal'; import { initFadeMotion } from '../../style/motion'; +import type { GenerateStyle } from '../../theme/internal'; const uploadAnimateInlineIn = new Keyframes('uploadAnimateInlineIn', { from: { diff --git a/components/upload/style/picture.ts b/components/upload/style/picture.ts index 5e469c5323..b57b5bd729 100644 --- a/components/upload/style/picture.ts +++ b/components/upload/style/picture.ts @@ -1,9 +1,9 @@ import { blue } from '@ant-design/colors'; +import { unit } from '@ant-design/cssinjs'; import type { UploadToken } from '.'; import { clearFix, textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; -import { unit } from '@ant-design/cssinjs'; const genPictureStyle: GenerateStyle = (token) => { const { componentCls, iconCls, uploadThumbnailSize, uploadProgressOffset, calc } = token; diff --git a/components/watermark/context.ts b/components/watermark/context.ts index d30a8add95..c5060f8282 100644 --- a/components/watermark/context.ts +++ b/components/watermark/context.ts @@ -1,5 +1,5 @@ -import { useEvent } from 'rc-util'; import * as React from 'react'; +import { useEvent } from 'rc-util'; export interface WatermarkContextProps { add: (ele: HTMLElement) => void; diff --git a/components/watermark/useRafDebounce.ts b/components/watermark/useRafDebounce.ts index 6936dd14f5..ff708012e4 100644 --- a/components/watermark/useRafDebounce.ts +++ b/components/watermark/useRafDebounce.ts @@ -1,6 +1,6 @@ import React from 'react'; -import raf from 'rc-util/lib/raf'; import { useEvent } from 'rc-util'; +import raf from 'rc-util/lib/raf'; /** * Callback will only execute last one for each raf diff --git a/docs/blog/issue-helper.en-US.md b/docs/blog/issue-helper.en-US.md index 0464c1b45e..cefaf22274 100644 --- a/docs/blog/issue-helper.en-US.md +++ b/docs/blog/issue-helper.en-US.md @@ -153,8 +153,8 @@ return {item.name}; #### 👼 'Bad Way' ```tsx -import { Menu } from 'antd'; import React from 'react'; +import { Menu } from 'antd'; const Demo: React.FC = () => { const [collapsed, setCollapsed] = useState(false); diff --git a/docs/blog/issue-helper.zh-CN.md b/docs/blog/issue-helper.zh-CN.md index 1ba1fd22dd..fa26206468 100644 --- a/docs/blog/issue-helper.zh-CN.md +++ b/docs/blog/issue-helper.zh-CN.md @@ -163,8 +163,8 @@ return {item.name}; #### 👼 “错误示范” ```tsx -import { Menu } from 'antd'; import React from 'react'; +import { Menu } from 'antd'; const Demo: React.FC = () => { const [collapsed, setCollapsed] = useState(false); diff --git a/docs/blog/tree-shaking.en-US.md b/docs/blog/tree-shaking.en-US.md index f5596de0cf..d277d8446c 100644 --- a/docs/blog/tree-shaking.en-US.md +++ b/docs/blog/tree-shaking.en-US.md @@ -95,6 +95,7 @@ Form also consumes the proxy Context: ```tsx // Sample only. Not real world code. import Form, { FormProvider } from 'rc-field-form'; + import { ValidateMessageContext } from './context'; export default (props) => { diff --git a/docs/blog/tree-shaking.zh-CN.md b/docs/blog/tree-shaking.zh-CN.md index 3971a2fd0a..87865bee56 100644 --- a/docs/blog/tree-shaking.zh-CN.md +++ b/docs/blog/tree-shaking.zh-CN.md @@ -95,6 +95,7 @@ const ConfigProvider = ({ validateMessages, children }) => { ```tsx // Sample only. Not real world code. import Form, { FormProvider } from 'rc-field-form'; + import { ValidateMessageContext } from './context'; export default (props) => { diff --git a/docs/react/getting-started.en-US.md b/docs/react/getting-started.en-US.md index a0cb48023b..766d6d1851 100755 --- a/docs/react/getting-started.en-US.md +++ b/docs/react/getting-started.en-US.md @@ -53,8 +53,9 @@ If you have already set things up by following the [Use with create-react-app](/ ```jsx import React, { useState } from 'react'; -import { createRoot } from 'react-dom/client'; import { DatePicker, message } from 'antd'; +import { createRoot } from 'react-dom/client'; + import './index.css'; const App = () => { diff --git a/docs/react/use-with-umi.en-US.md b/docs/react/use-with-umi.en-US.md index 108f46e0e4..5af72fc09e 100644 --- a/docs/react/use-with-umi.en-US.md +++ b/docs/react/use-with-umi.en-US.md @@ -221,11 +221,12 @@ export default defineConfig({ Edit `src/pages/products.tsx` with the following code. ```tsx -import axios from 'axios'; import React from 'react'; +import axios from 'axios'; import { useMutation, useQuery, useQueryClient } from 'umi'; -import ProductList from '@/components/ProductList'; + import styles from './products.less'; +import ProductList from '@/components/ProductList'; export default function Page() { const queryClient = useQueryClient(); diff --git a/docs/spec/motion.en-US.md b/docs/spec/motion.en-US.md index a2004da85e..3b4db84212 100644 --- a/docs/spec/motion.en-US.md +++ b/docs/spec/motion.en-US.md @@ -54,7 +54,7 @@ const text = [ ]; function Principle() { - const childrenToRender = text.map(item => ( + const childrenToRender = text.map((item) => (
diff --git a/docs/spec/shadow.en-US.md b/docs/spec/shadow.en-US.md index cda9f094ae..62f1a23c85 100644 --- a/docs/spec/shadow.en-US.md +++ b/docs/spec/shadow.en-US.md @@ -26,7 +26,7 @@ Shadows are produced by two surfaces at different levels, and the intensity is d height layer 1
-**Layer 2**: When an object appears at the medium level, it expands and follows the relationship with the reference layer. The object opens from elements on the ground and moves with the movement of the elements at that level. For example: dropdown panels. +**Layer 2**: When an object appears at the medium level, it expands and follows the relationship with the reference layer. The object opens from elements on the ground and moves with the movement of the elements at that level. For example: dropdown panels.
height layer 2 diff --git a/scripts/check-repo.ts b/scripts/check-repo.ts index b0d06aa37e..118082938b 100644 --- a/scripts/check-repo.ts +++ b/scripts/check-repo.ts @@ -1,8 +1,10 @@ /* eslint-disable no-console */ import chalk from 'chalk'; import fetch from 'isomorphic-fetch'; -import simpleGit, { type StatusResult } from 'simple-git'; import ora from 'ora'; +import simpleGit from 'simple-git'; +import type { StatusResult } from 'simple-git'; + import localPackage from '../package.json'; const { version } = localPackage; diff --git a/scripts/check-version-md.ts b/scripts/check-version-md.ts index 0bf40ea2a1..cf2c10c7f6 100644 --- a/scripts/check-version-md.ts +++ b/scripts/check-version-md.ts @@ -4,6 +4,7 @@ import { join } from 'path'; import chalk from 'chalk'; import dayjs from 'dayjs'; import isBetween from 'dayjs/plugin/isBetween'; + import localPackage from '../package.json'; const { version } = localPackage; diff --git a/scripts/collect-token-statistic.ts b/scripts/collect-token-statistic.ts index bd550363fb..8271758d57 100644 --- a/scripts/collect-token-statistic.ts +++ b/scripts/collect-token-statistic.ts @@ -1,8 +1,8 @@ /* eslint-disable no-console */ import React from 'react'; import chalk from 'chalk'; -import fs from 'fs-extra'; import cliProgress from 'cli-progress'; +import fs from 'fs-extra'; import ReactDOMServer from 'react-dom/server'; import { DesignTokenContext } from '../components/theme/internal'; diff --git a/scripts/generate-version.ts b/scripts/generate-version.ts index 506a8e0753..c4e89dd6bb 100644 --- a/scripts/generate-version.ts +++ b/scripts/generate-version.ts @@ -1,5 +1,6 @@ import fs from 'fs'; import path from 'path'; + import localPackage from '../package.json'; const { version } = localPackage; diff --git a/scripts/post-publish.ts b/scripts/post-publish.ts index bf54566dd2..e7c56ca691 100644 --- a/scripts/post-publish.ts +++ b/scripts/post-publish.ts @@ -6,6 +6,7 @@ import relativeTime from 'dayjs/plugin/relativeTime'; import inquirer from 'inquirer'; import fetch from 'isomorphic-fetch'; import semver from 'semver'; + import deprecatedVersions from '../BUG_VERSIONS.json'; dayjs.extend(relativeTime); diff --git a/scripts/pre-publish.ts b/scripts/pre-publish.ts index bb1c548bb0..ac8f85e956 100644 --- a/scripts/pre-publish.ts +++ b/scripts/pre-publish.ts @@ -2,11 +2,12 @@ import fs from 'node:fs'; import runScript from '@npmcli/run-script'; import { Octokit } from '@octokit/rest'; -import ora from 'ora'; -import chalk from 'chalk'; import AdmZip from 'adm-zip'; import axios from 'axios'; +import chalk from 'chalk'; import cliProgress from 'cli-progress'; +import ora from 'ora'; + import checkRepo from './check-repo'; const { Notification: Notifier } = require('node-notifier'); diff --git a/scripts/previewEditor/template.html b/scripts/previewEditor/template.html index e6d292b3f0..87bd39e396 100644 --- a/scripts/previewEditor/template.html +++ b/scripts/previewEditor/template.html @@ -1,27 +1,27 @@ - - - - Ant Design CHANGELOG Generator - - - - - - - -
- - - + + + + + Ant Design CHANGELOG Generator + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/scripts/visual-regression/report-template.html b/scripts/visual-regression/report-template.html index 96c3f4aac7..34f36beb7f 100644 --- a/scripts/visual-regression/report-template.html +++ b/scripts/visual-regression/report-template.html @@ -1,4 +1,4 @@ - + diff --git a/tests/__mocks__/@rc-component/trigger.tsx b/tests/__mocks__/@rc-component/trigger.tsx index 1c331e7774..c1b440b0b9 100644 --- a/tests/__mocks__/@rc-component/trigger.tsx +++ b/tests/__mocks__/@rc-component/trigger.tsx @@ -1,6 +1,7 @@ +import * as React from 'react'; import type { TriggerProps, TriggerRef } from '@rc-component/trigger'; import MockTrigger from '@rc-component/trigger/lib/mock'; -import * as React from 'react'; + import { TriggerMockContext } from '../../shared/demoTestContext'; let OriginTrigger = jest.requireActual('@rc-component/trigger'); diff --git a/tests/index.html b/tests/index.html index a0ef191204..3bfd5e1df2 100644 --- a/tests/index.html +++ b/tests/index.html @@ -1,16 +1,19 @@ - - - - Amazing Antd - - - -
- - + + + + + Amazing Antd + + + + +
+ + + \ No newline at end of file diff --git a/tests/shared/accessibilityTest.tsx b/tests/shared/accessibilityTest.tsx index 6da03983dd..b1c6e34219 100644 --- a/tests/shared/accessibilityTest.tsx +++ b/tests/shared/accessibilityTest.tsx @@ -1,6 +1,6 @@ +import React from 'react'; import { render } from '@testing-library/react'; import { axe } from 'jest-axe'; -import React from 'react'; // eslint-disable-next-line jest/no-export export default function accessibilityTest(Component: React.ComponentType) { diff --git a/tests/shared/demoTestContext.ts b/tests/shared/demoTestContext.ts index 0e1c6e5a11..2c6becfb5b 100644 --- a/tests/shared/demoTestContext.ts +++ b/tests/shared/demoTestContext.ts @@ -1,6 +1,6 @@ /* eslint-disable import/prefer-default-export */ -import type { TriggerProps } from '@rc-component/trigger'; import * as React from 'react'; +import type { TriggerProps } from '@rc-component/trigger'; // We export context here is to avoid testing-lib inject `afterEach` in `tests/index.test.js` // Which breaks the circle deps diff --git a/tests/shared/focusTest.tsx b/tests/shared/focusTest.tsx index 810379cca8..1f2dab8ea9 100644 --- a/tests/shared/focusTest.tsx +++ b/tests/shared/focusTest.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { fireEvent, render, sleep } from '../utils'; const focusTest = ( diff --git a/tests/shared/mountTest.tsx b/tests/shared/mountTest.tsx index a6ed7fb68d..7eda19fb9d 100644 --- a/tests/shared/mountTest.tsx +++ b/tests/shared/mountTest.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { render } from '../utils'; // eslint-disable-next-line jest/no-export diff --git a/tests/shared/rtlTest.tsx b/tests/shared/rtlTest.tsx index 8905296abd..47b17a6c26 100644 --- a/tests/shared/rtlTest.tsx +++ b/tests/shared/rtlTest.tsx @@ -1,6 +1,7 @@ +import React from 'react'; import dayjs from 'dayjs'; import MockDate from 'mockdate'; -import React from 'react'; + import ConfigProvider from '../../components/config-provider'; import { render } from '../utils'; diff --git a/typings/custom-typings.d.ts b/typings/custom-typings.d.ts index 26a324d4f6..5db6d572f5 100644 --- a/typings/custom-typings.d.ts +++ b/typings/custom-typings.d.ts @@ -10,6 +10,8 @@ declare module '*.svg' { declare module 'rc-util*'; +declare module 'jsonml-to-react-element'; + declare module 'jsonml.js/*'; declare module '*.json' {