diff --git a/components/_util/__tests__/useZIndex.test.tsx b/components/_util/__tests__/useZIndex.test.tsx index 1f2813cf53..76b1bb4c77 100644 --- a/components/_util/__tests__/useZIndex.test.tsx +++ b/components/_util/__tests__/useZIndex.test.tsx @@ -26,7 +26,7 @@ import { import type { ZIndexConsumer, ZIndexContainer } from '../hooks/useZIndex'; import { consumerBaseZIndexOffset, containerBaseZIndexOffset, useZIndex } from '../hooks/useZIndex'; import { resetWarned } from '../warning'; -import zIndexContext from '../zindexContext'; +import ZIndexContext from '../zindexContext'; // TODO: Remove this. Mock for React 19 jest.mock('react-dom', () => { @@ -45,7 +45,7 @@ const WrapWithProvider: React.FC { const [, contextZIndex] = useZIndex(container); - return {children}; + return {children}; }; const containerComponent: Partial< diff --git a/components/_util/hooks/useZIndex.ts b/components/_util/hooks/useZIndex.ts index cc8aa5f86b..e580e6021e 100644 --- a/components/_util/hooks/useZIndex.ts +++ b/components/_util/hooks/useZIndex.ts @@ -2,7 +2,7 @@ import React from 'react'; import useToken from '../../theme/useToken'; import { devUseWarning } from '../warning'; -import zIndexContext from '../zindexContext'; +import ZIndexContext from '../zindexContext'; export type ZIndexContainer = | 'Modal' @@ -61,7 +61,7 @@ export const useZIndex = ( customZIndex?: number, ): ReturnResult => { const [, token] = useToken(); - const parentZIndex = React.useContext(zIndexContext); + const parentZIndex = React.useContext(ZIndexContext); const isContainer = isContainerType(componentType); let result: ReturnResult; diff --git a/components/_util/zindexContext.ts b/components/_util/zindexContext.ts index 39df635c16..93e884547e 100644 --- a/components/_util/zindexContext.ts +++ b/components/_util/zindexContext.ts @@ -1,9 +1,9 @@ import React from 'react'; -const zIndexContext = React.createContext(undefined); +const ZIndexContext = React.createContext(undefined); if (process.env.NODE_ENV !== 'production') { - zIndexContext.displayName = 'zIndexContext'; + ZIndexContext.displayName = 'ZIndexContext'; } -export default zIndexContext; +export default ZIndexContext; diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 846bd60e40..a88b1f30a8 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -16,7 +16,7 @@ import { getTransitionName } from '../_util/motion'; import type { Breakpoint } from '../_util/responsiveObserver'; import { canUseDocElement } from '../_util/styleChecker'; import { devUseWarning } from '../_util/warning'; -import zIndexContext from '../_util/zindexContext'; +import ZIndexContext from '../_util/zindexContext'; import { ConfigContext } from '../config-provider'; import { useComponentConfig } from '../config-provider/context'; import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; @@ -241,7 +241,7 @@ const Modal: React.FC = (props) => { // =========================== Render =========================== return ( - + = (props) => { children )} - + ); }; diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index ca2dd4e041..420f5563e4 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -20,7 +20,7 @@ import getPlacements from '../_util/placements'; import { cloneElement, isFragment } from '../_util/reactNode'; import type { LiteralUnion } from '../_util/type'; import { devUseWarning } from '../_util/warning'; -import zIndexContext from '../_util/zindexContext'; +import ZIndexContext from '../_util/zindexContext'; import { useComponentConfig } from '../config-provider/context'; import useCSSVarCls from '../config-provider/hooks/useCSSVarCls'; import { useToken } from '../theme/internal'; @@ -399,7 +399,7 @@ const InternalTooltip = React.forwardRef((prop ); - return {content}; + return {content}; }); type CompoundedComponent = typeof InternalTooltip & { diff --git a/components/tour/index.tsx b/components/tour/index.tsx index 5152394167..2996b5ae5f 100644 --- a/components/tour/index.tsx +++ b/components/tour/index.tsx @@ -5,7 +5,7 @@ import { clsx } from 'clsx'; import { useMergeSemantic, useZIndex } from '../_util/hooks'; import getPlacements from '../_util/placements'; -import zIndexContext from '../_util/zindexContext'; +import ZIndexContext from '../_util/zindexContext'; import { useComponentConfig } from '../config-provider/context'; import { useToken } from '../theme/internal'; import type { @@ -132,7 +132,7 @@ const Tour: React.FC & { _InternalPanelDoNotUseOrYouWillBeFired: type const [zIndex, contextZIndex] = useZIndex('Tour', restProps.zIndex); return ( - + & { _InternalPanelDoNotUseOrYouWillBeFired: type builtinPlacements={builtinPlacements} steps={mergedSteps} /> - + ); }; diff --git a/eslint.config.mjs b/eslint.config.mjs index 813d3c68da..257cf6756e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -64,6 +64,8 @@ export default antfu( 'react-hooks/set-state-in-effect': 'off', 'react-hooks/refs': 'off', 'react/no-implicit-key': 'off', + 'react-naming-convention/ref-name': 'off', + 'react-naming-convention/use-state': 'off', }, }, { diff --git a/package.json b/package.json index f5409d6359..70ee58035e 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,7 @@ "@ant-design/tools": "^19.1.0", "@ant-design/x": "^2.2.0", "@ant-design/x-sdk": "^2.2.0", - "@antfu/eslint-config": "^7.0.0", + "@antfu/eslint-config": "^7.3.0", "@biomejs/biome": "^2.3.10", "@blazediff/core": "^1.7.0", "@codecov/webpack-plugin": "^1.9.1", @@ -175,7 +175,7 @@ "@emotion/css": "^11.13.5", "@emotion/react": "^11.14.0", "@emotion/server": "^11.11.0", - "@eslint-react/eslint-plugin": "2.11.0", + "@eslint-react/eslint-plugin": "2.12.1", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@inquirer/prompts": "^8.0.2", "@madccc/duplicate-package-checker-webpack-plugin": "^1.0.0",