From 39fe6d4568f4a1de0f2c2ef9430a9473912bc15b Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 29 Jun 2026 18:18:38 +0800 Subject: [PATCH 01/18] chore: update maintenance dependencies --- .github/dependabot.yml | 8 ++++ README.md | 2 +- README.zh-CN.md | 2 +- eslint.config.mjs | 84 ++++++++++++++++++++++++++++++++++++++++++ global.d.ts | 67 +++++++++++++++++++++++++++++++++ package.json | 29 ++++++++++----- react-compat.d.ts | 21 +++++++++++ tsconfig.json | 35 ++++++++---------- 8 files changed, 217 insertions(+), 31 deletions(-) create mode 100644 eslint.config.mjs create mode 100644 global.d.ts create mode 100644 react-compat.d.ts diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3b730ef..5e6c7fa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: time: '21:00' timezone: Asia/Shanghai open-pull-requests-limit: 10 + groups: + npm-dependencies: + patterns: + - '*' - package-ecosystem: github-actions directory: '/' @@ -17,3 +21,7 @@ updates: time: '21:00' timezone: Asia/Shanghai open-pull-requests-limit: 10 + groups: + github-actions: + patterns: + - '*' diff --git a/README.md b/README.md index f3de7d7..9e53dfc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

@rc-component/motion

-

Ant Design Part of the Ant Design ecosystem.

+

Ant Design Part of the Ant Design ecosystem.

🎞️ Lifecycle-driven motion primitives for React enter, leave, and list animations.

diff --git a/README.zh-CN.md b/README.zh-CN.md index ee7045a..7cc6446 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,6 +1,6 @@

@rc-component/motion

-

Ant Design Ant Design η”Ÿζ€ηš„δΈ€ιƒ¨εˆ†γ€‚

+

Ant Design Ant Design η”Ÿζ€ηš„δΈ€ιƒ¨εˆ†γ€‚

🎞️ React εŠ¨ζ•ˆεŸΊη‘€η»„δ»ΆοΌŒε°θ£… CSS εŠ¨η”»γ€θΏ‡ζΈ‘ε’Œη”Ÿε‘½ε‘¨ζœŸηŠΆζ€γ€‚

diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..dfa7e3e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,84 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import tsEslintPlugin from '@typescript-eslint/eslint-plugin'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const require = createRequire(import.meta.url); + +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +const recommendedTsRules = new Set( + Object.keys(tsEslintPlugin.configs.recommended.rules || {}), +); +const noopRule = { + meta: { type: 'problem', docs: {}, schema: [] }, + create: () => ({}), +}; + +function normalizeConfig(config) { + const next = { ...config }; + + if (next.plugins?.['@typescript-eslint']) { + next.plugins = { + ...next.plugins, + '@typescript-eslint': { + ...next.plugins['@typescript-eslint'], + rules: { + ...next.plugins['@typescript-eslint'].rules, + 'ban-types': noopRule, + }, + }, + }; + } + + if (next.rules) { + next.rules = Object.fromEntries( + Object.entries(next.rules).filter(([ruleName]) => { + if (!ruleName.startsWith('@typescript-eslint/')) { + return true; + } + return ( + recommendedTsRules.has(ruleName) || + ruleName === '@typescript-eslint/ban-types' + ); + }), + ); + } + + return next; +} + +export default [ + { + ignores: [ + 'node_modules/', + 'coverage/', + 'es/', + 'lib/', + 'dist/', + 'docs-dist/', + '.dumi/', + '.doc/', + '.vercel/', + '.eslintrc.js', + 'src/index.d.ts', + ], + }, + ...compat.config(require('./.eslintrc.js')).map(normalizeConfig), + { + rules: { + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-unused-vars': 'off', + }, + }, +]; diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 0000000..a8c536f --- /dev/null +++ b/global.d.ts @@ -0,0 +1,67 @@ +/// +/// +/// +/// +/// + +declare module '*.css'; +declare module '*.less'; +declare module 'jsonp'; + +declare namespace JSX { + type Element = React.JSX.Element; + interface ElementClass extends React.JSX.ElementClass {} + interface ElementAttributesProperty + extends React.JSX.ElementAttributesProperty {} + interface ElementChildrenAttribute + extends React.JSX.ElementChildrenAttribute {} + type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes< + C, + P + >; + interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} + interface IntrinsicClassAttributes extends React.JSX + .IntrinsicClassAttributes {} + interface IntrinsicElements extends React.JSX.IntrinsicElements {} +} + +declare namespace jest { + interface Matchers { + lastCalledWith(...expected: unknown[]): R; + nthCalledWith(nthCall: number, ...expected: unknown[]): R; + toBeCalled(): R; + toBeCalledTimes(expected: number): R; + toBeCalledWith(...expected: unknown[]): R; + } +} + +declare const vi: { + fn: any = (...args: any[]) => any>( + implementation?: T, + ) => jest.MockedFunction; + mock: ( + moduleName: string, + factory?: (importOriginal: () => Promise) => unknown, + ) => void; + spyOn: typeof jest.spyOn; + useFakeTimers: () => void; + useRealTimers: () => void; + advanceTimersByTime: (msToRun: number) => void; + clearAllTimers: () => void; + runAllTimers: () => void; + importActual: (moduleName: string) => Promise; + clearAllMocks: () => void; + resetAllMocks: () => void; + restoreAllMocks: () => void; +}; + +declare const describe: any; +declare const it: any; +declare const test: any; +declare const beforeEach: any; +declare const afterEach: any; +declare const beforeAll: any; +declare const afterAll: any; +declare const expect: any; + +declare module 'moment/locale/zh-cn'; diff --git a/package.json b/package.json index a43afdd..30faf81 100644 --- a/package.json +++ b/package.json @@ -55,24 +55,35 @@ "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^15.0.7", - "@types/jest": "^29.5.14", + "@testing-library/react": "^16.3.2", + "@types/jest": "^30.0.0", "@types/node": "^26.0.1", - "@types/react": "^18.3.31", - "@types/react-dom": "^18.3.7", + "@types/react": "^19.2.17", + "@types/react-dom": "^19.2.3", "@umijs/fabric": "^4.0.1", "cross-env": "^10.1.0", "dumi": "^2.4.35", - "eslint": "^8.57.1", + "eslint": "^9.39.4", "father": "^4.6.23", "gh-pages": "^6.3.0", "husky": "^9.1.7", - "lint-staged": "^16.4.0", + "lint-staged": "^17.0.8", "prettier": "^3.9.0", "rc-test": "^7.1.3", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "typescript": "^5.9.3" + "react": "^19.2.7", + "react-dom": "^19.2.7", + "typescript": "^6.0.3", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "^9.39.4", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-config-prettier": "^10.1.8", + "@babel/eslint-parser": "^7.29.7", + "@babel/eslint-plugin": "^7.29.7", + "@typescript-eslint/eslint-plugin": "^8.62.0", + "@typescript-eslint/parser": "^8.62.0", + "eslint-plugin-jest": "^29.15.3", + "eslint-plugin-unicorn": "^65.0.1" }, "peerDependencies": { "react": ">=16.9.0", diff --git a/react-compat.d.ts b/react-compat.d.ts new file mode 100644 index 0000000..b8bf491 --- /dev/null +++ b/react-compat.d.ts @@ -0,0 +1,21 @@ +import * as React from 'react'; + +declare module 'react' { + type ReactText = string | number; + function useRef(): React.MutableRefObject; + function isValidElement

( + object: {} | null | undefined, + ): object is React.ReactElement

; + function cloneElement

( + element: React.ReactElement

, + props?: (Partial

& React.Attributes) | null, + ...children: React.ReactNode[] + ): React.ReactElement

; +} + +declare module 'react-dom' { + function hydrate( + element: React.ReactNode, + container: Element | DocumentFragment, + ): void; +} diff --git a/tsconfig.json b/tsconfig.json index fbc3458..4dafda2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,32 +8,27 @@ "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": [ - "src/*" - ], - "@@/*": [ - ".dumi/tmp/*" - ], - "@rc-component/motion": [ - "src/index.tsx" - ], - "rc-motion": [ - "src/index.tsx" - ] + "@/*": ["src/*"], + "@@/*": [".dumi/tmp/*"], + "@rc-component/motion": ["src/index.tsx"], + "rc-motion": ["src/index.tsx"] }, - "ignoreDeprecations": "5.0" + "ignoreDeprecations": "6.0", + "noImplicitAny": false, + "strictNullChecks": false, + "strictPropertyInitialization": false, + "strictFunctionTypes": false, + "strict": false, + "noImplicitThis": false, + "strictBindCallApply": false }, "include": [ + "react-compat.d.ts", + "global.d.ts", "src", "docs", ".dumirc.ts", ".fatherrc.ts" ], - "exclude": [ - "node_modules", - "lib", - "es", - "dist", - "docs-dist" - ] + "exclude": ["node_modules", "lib", "es", "dist", "docs-dist"] } From 3a8c1e3298c51fc43ac712968cfa63e317da9f2d Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 10:20:17 +0800 Subject: [PATCH 02/18] fix: align TypeScript and ESLint compatibility --- eslint.config.mjs | 24 ++++++++++++++---------- global.d.ts | 9 --------- tsconfig.json | 15 +++++++-------- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index dfa7e3e..f556e5a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -27,16 +27,8 @@ function normalizeConfig(config) { const next = { ...config }; if (next.plugins?.['@typescript-eslint']) { - next.plugins = { - ...next.plugins, - '@typescript-eslint': { - ...next.plugins['@typescript-eslint'], - rules: { - ...next.plugins['@typescript-eslint'].rules, - 'ban-types': noopRule, - }, - }, - }; + next.plugins = { ...next.plugins }; + delete next.plugins['@typescript-eslint']; } if (next.rules) { @@ -72,6 +64,18 @@ export default [ 'src/index.d.ts', ], }, + { + plugins: { + '@typescript-eslint': { + ...tsEslintPlugin, + rules: { + ...tsEslintPlugin.rules, + 'ban-types': noopRule, + 'consistent-type-exports': noopRule, + }, + }, + }, + }, ...compat.config(require('./.eslintrc.js')).map(normalizeConfig), { rules: { diff --git a/global.d.ts b/global.d.ts index a8c536f..bbd470e 100644 --- a/global.d.ts +++ b/global.d.ts @@ -55,13 +55,4 @@ declare const vi: { restoreAllMocks: () => void; }; -declare const describe: any; -declare const it: any; -declare const test: any; -declare const beforeEach: any; -declare const afterEach: any; -declare const beforeAll: any; -declare const afterAll: any; -declare const expect: any; - declare module 'moment/locale/zh-cn'; diff --git a/tsconfig.json b/tsconfig.json index 4dafda2..b894dcb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,26 +1,25 @@ { "compilerOptions": { "target": "esnext", - "moduleResolution": "node", - "baseUrl": "./", + "moduleResolution": "bundler", "jsx": "react", "declaration": true, "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/motion": ["src/index.tsx"], - "rc-motion": ["src/index.tsx"] + "@/*": ["./src/*"], + "@@/*": ["./.dumi/tmp/*"], + "@rc-component/motion": ["./src/index.tsx"], + "rc-motion": ["./src/index.tsx"] }, - "ignoreDeprecations": "6.0", "noImplicitAny": false, "strictNullChecks": false, "strictPropertyInitialization": false, "strictFunctionTypes": false, "strict": false, "noImplicitThis": false, - "strictBindCallApply": false + "strictBindCallApply": false, + "module": "ESNext" }, "include": [ "react-compat.d.ts", From d8d23f2d62b04cc233b7105b9056831f8f306517 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 10:50:22 +0800 Subject: [PATCH 03/18] chore: use testing-library dom events --- package.json | 25 +++++++++++++------------ tests/CSSMotion.spec.tsx | 3 ++- tests/CSSMotionList.spec.tsx | 3 ++- tests/StrictMode.spec.tsx | 3 ++- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 30faf81..4a55122 100644 --- a/package.json +++ b/package.json @@ -52,18 +52,30 @@ "clsx": "^2.1.1" }, "devDependencies": { + "@babel/eslint-parser": "^7.29.7", + "@babel/eslint-plugin": "^7.29.7", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "^9.39.4", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", + "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.2", "@types/jest": "^30.0.0", "@types/node": "^26.0.1", "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", + "@typescript-eslint/eslint-plugin": "^8.62.0", + "@typescript-eslint/parser": "^8.62.0", "@umijs/fabric": "^4.0.1", "cross-env": "^10.1.0", "dumi": "^2.4.35", "eslint": "^9.39.4", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-jest": "^29.15.3", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^7.1.1", + "eslint-plugin-unicorn": "^65.0.1", "father": "^4.6.23", "gh-pages": "^6.3.0", "husky": "^9.1.7", @@ -72,18 +84,7 @@ "rc-test": "^7.1.3", "react": "^19.2.7", "react-dom": "^19.2.7", - "typescript": "^6.0.3", - "@eslint/eslintrc": "^3.3.5", - "@eslint/js": "^9.39.4", - "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^7.1.1", - "eslint-config-prettier": "^10.1.8", - "@babel/eslint-parser": "^7.29.7", - "@babel/eslint-plugin": "^7.29.7", - "@typescript-eslint/eslint-plugin": "^8.62.0", - "@typescript-eslint/parser": "^8.62.0", - "eslint-plugin-jest": "^29.15.3", - "eslint-plugin-unicorn": "^65.0.1" + "typescript": "^6.0.3" }, "peerDependencies": { "react": ">=16.9.0", diff --git a/tests/CSSMotion.spec.tsx b/tests/CSSMotion.spec.tsx index 848bfe9..f54ec66 100644 --- a/tests/CSSMotion.spec.tsx +++ b/tests/CSSMotion.spec.tsx @@ -1,8 +1,9 @@ +import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, max-classes-per-file, react/prefer-stateless-function, react/no-multi-comp */ -import { act, fireEvent, render } from '@testing-library/react'; +import { act, render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/tests/CSSMotionList.spec.tsx b/tests/CSSMotionList.spec.tsx index eff199c..1df14e9 100644 --- a/tests/CSSMotionList.spec.tsx +++ b/tests/CSSMotionList.spec.tsx @@ -1,6 +1,7 @@ +import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, react/prefer-stateless-function, react/no-multi-comp, @typescript-eslint/no-implied-eval */ -import { fireEvent, render } from '@testing-library/react'; +import { render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import { act } from 'react-dom/test-utils'; diff --git a/tests/StrictMode.spec.tsx b/tests/StrictMode.spec.tsx index 7dc872f..1c05328 100644 --- a/tests/StrictMode.spec.tsx +++ b/tests/StrictMode.spec.tsx @@ -1,8 +1,9 @@ +import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, max-classes-per-file, react/prefer-stateless-function, react/no-multi-comp */ -import { act, fireEvent, render } from '@testing-library/react'; +import { act, render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import { genCSSMotion, type CSSMotionRef } from '../src/CSSMotion'; From 7362270da1f3aad5275cd9ac1f1a7adfe14b7cc4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 11:15:36 +0800 Subject: [PATCH 04/18] test: keep react testing event behavior --- tests/CSSMotion.spec.tsx | 9 +++++++-- tests/CSSMotionList.spec.tsx | 3 +-- tests/StrictMode.spec.tsx | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/CSSMotion.spec.tsx b/tests/CSSMotion.spec.tsx index f54ec66..574c877 100644 --- a/tests/CSSMotion.spec.tsx +++ b/tests/CSSMotion.spec.tsx @@ -1,9 +1,8 @@ -import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, max-classes-per-file, react/prefer-stateless-function, react/no-multi-comp */ -import { act, render } from '@testing-library/react'; +import { act, fireEvent, render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import ReactDOM from 'react-dom'; @@ -857,6 +856,12 @@ describe('CSSMotion', () => { describe('strict mode', () => { beforeEach(() => { + if (!('findDOMNode' in ReactDOM)) { + Object.defineProperty(ReactDOM, 'findDOMNode', { + value: jest.fn(), + configurable: true, + }); + } jest.spyOn(ReactDOM, 'findDOMNode'); }); diff --git a/tests/CSSMotionList.spec.tsx b/tests/CSSMotionList.spec.tsx index 1df14e9..eff199c 100644 --- a/tests/CSSMotionList.spec.tsx +++ b/tests/CSSMotionList.spec.tsx @@ -1,7 +1,6 @@ -import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, react/prefer-stateless-function, react/no-multi-comp, @typescript-eslint/no-implied-eval */ -import { render } from '@testing-library/react'; +import { fireEvent, render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import { act } from 'react-dom/test-utils'; diff --git a/tests/StrictMode.spec.tsx b/tests/StrictMode.spec.tsx index 1c05328..7dc872f 100644 --- a/tests/StrictMode.spec.tsx +++ b/tests/StrictMode.spec.tsx @@ -1,9 +1,8 @@ -import { fireEvent } from '@testing-library/dom'; /* eslint-disable react/no-render-return-value, max-classes-per-file, react/prefer-stateless-function, react/no-multi-comp */ -import { act, render } from '@testing-library/react'; +import { act, fireEvent, render } from '@testing-library/react'; import { clsx } from 'clsx'; import React from 'react'; import { genCSSMotion, type CSSMotionRef } from '../src/CSSMotion'; From 23a2cad7ad8f8d63f840d2b2bf6fd82fa6d4f64b Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 11:26:43 +0800 Subject: [PATCH 05/18] docs: use hydrateRoot in SSR demo --- docs/examples/ssr.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/examples/ssr.tsx b/docs/examples/ssr.tsx index 95b06d1..1c97c7b 100644 --- a/docs/examples/ssr.tsx +++ b/docs/examples/ssr.tsx @@ -1,7 +1,7 @@ import { clsx } from 'clsx'; import CSSMotion, { genCSSMotion } from 'rc-motion'; import React from 'react'; -import { hydrate } from 'react-dom'; +import { hydrateRoot } from 'react-dom/client'; import ReactDOMServer from 'react-dom/server'; import './basic.less'; @@ -44,9 +44,10 @@ const App = () => { document.body.appendChild(div); div.innerHTML = ssr; - hydrate(, div); + const root = hydrateRoot(div, ); return () => { + root.unmount(); document.body.removeChild(div); }; }, []); From 5ce17917d4600b03ae63001e5e113224c32038e4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 19:03:23 +0800 Subject: [PATCH 06/18] chore: address review comments --- eslint.config.mjs | 30 ++++++++++-------------------- react-compat.d.ts | 7 ------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index f556e5a..3166a6d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,13 +15,14 @@ const compat = new FlatCompat({ allConfig: js.configs.all, }); -const recommendedTsRules = new Set( - Object.keys(tsEslintPlugin.configs.recommended.rules || {}), -); -const noopRule = { - meta: { type: 'problem', docs: {}, schema: [] }, - create: () => ({}), -}; +const recommendedTsRulesConfig = tsEslintPlugin.configs.recommended; +const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig) + ? recommendedTsRulesConfig.reduce( + (rules, config) => ({ ...rules, ...(config.rules || {}) }), + {}, + ) + : recommendedTsRulesConfig?.rules || {}; +const recommendedTsRules = new Set(Object.keys(recommendedTsRulesObject)); function normalizeConfig(config) { const next = { ...config }; @@ -37,10 +38,7 @@ function normalizeConfig(config) { if (!ruleName.startsWith('@typescript-eslint/')) { return true; } - return ( - recommendedTsRules.has(ruleName) || - ruleName === '@typescript-eslint/ban-types' - ); + return recommendedTsRules.has(ruleName); }), ); } @@ -66,20 +64,12 @@ export default [ }, { plugins: { - '@typescript-eslint': { - ...tsEslintPlugin, - rules: { - ...tsEslintPlugin.rules, - 'ban-types': noopRule, - 'consistent-type-exports': noopRule, - }, - }, + '@typescript-eslint': tsEslintPlugin, }, }, ...compat.config(require('./.eslintrc.js')).map(normalizeConfig), { rules: { - '@typescript-eslint/ban-types': 'off', '@typescript-eslint/no-empty-object-type': 'off', '@typescript-eslint/no-unsafe-function-type': 'off', '@typescript-eslint/no-unused-vars': 'off', diff --git a/react-compat.d.ts b/react-compat.d.ts index b8bf491..9650edc 100644 --- a/react-compat.d.ts +++ b/react-compat.d.ts @@ -12,10 +12,3 @@ declare module 'react' { ...children: React.ReactNode[] ): React.ReactElement

; } - -declare module 'react-dom' { - function hydrate( - element: React.ReactNode, - container: Element | DocumentFragment, - ): void; -} From ccc991babdc2c25d21c8a59926c8ae4e92cd72d0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 30 Jun 2026 19:16:10 +0800 Subject: [PATCH 07/18] fix: keep compatible eslint export rule --- eslint.config.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 3166a6d..0e70eed 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -23,6 +23,10 @@ const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig) ) : recommendedTsRulesConfig?.rules || {}; const recommendedTsRules = new Set(Object.keys(recommendedTsRulesObject)); +const noopRule = { + meta: { type: 'problem', docs: {}, schema: [] }, + create: () => ({}), +}; function normalizeConfig(config) { const next = { ...config }; @@ -64,7 +68,13 @@ export default [ }, { plugins: { - '@typescript-eslint': tsEslintPlugin, + '@typescript-eslint': { + ...tsEslintPlugin, + rules: { + ...tsEslintPlugin.rules, + 'consistent-type-exports': noopRule, + }, + }, }, }, ...compat.config(require('./.eslintrc.js')).map(normalizeConfig), From 0c3d721b13a1ed9a5039dd0e11cc38bc8ea24ee5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 12:44:30 +0800 Subject: [PATCH 08/18] chore: clean up test globals --- global.d.ts | 20 -------------------- tests/CSSMotion.spec.tsx | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/global.d.ts b/global.d.ts index bbd470e..bb2b627 100644 --- a/global.d.ts +++ b/global.d.ts @@ -35,24 +35,4 @@ declare namespace jest { } } -declare const vi: { - fn: any = (...args: any[]) => any>( - implementation?: T, - ) => jest.MockedFunction; - mock: ( - moduleName: string, - factory?: (importOriginal: () => Promise) => unknown, - ) => void; - spyOn: typeof jest.spyOn; - useFakeTimers: () => void; - useRealTimers: () => void; - advanceTimersByTime: (msToRun: number) => void; - clearAllTimers: () => void; - runAllTimers: () => void; - importActual: (moduleName: string) => Promise; - clearAllMocks: () => void; - resetAllMocks: () => void; - restoreAllMocks: () => void; -}; - declare module 'moment/locale/zh-cn'; diff --git a/tests/CSSMotion.spec.tsx b/tests/CSSMotion.spec.tsx index 574c877..c378d8d 100644 --- a/tests/CSSMotion.spec.tsx +++ b/tests/CSSMotion.spec.tsx @@ -859,6 +859,7 @@ describe('CSSMotion', () => { if (!('findDOMNode' in ReactDOM)) { Object.defineProperty(ReactDOM, 'findDOMNode', { value: jest.fn(), + writable: true, configurable: true, }); } From 78268929fff2d89cb641bc4fa08627014c83f691 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 12:53:18 +0800 Subject: [PATCH 09/18] chore: preserve local eslint rule overrides --- eslint.config.mjs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 0e70eed..bedc35b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,7 @@ const compat = new FlatCompat({ allConfig: js.configs.all, }); +const legacyConfig = require('./.eslintrc.js'); const recommendedTsRulesConfig = tsEslintPlugin.configs.recommended; const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig) ? recommendedTsRulesConfig.reduce( @@ -23,6 +24,18 @@ const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig) ) : recommendedTsRulesConfig?.rules || {}; const recommendedTsRules = new Set(Object.keys(recommendedTsRulesObject)); + +function hasCurrentTsRule(ruleName) { + const tsRuleName = ruleName.replace('@typescript-eslint/', ''); + return Boolean(tsEslintPlugin.rules[tsRuleName]); +} +const localTsRules = new Set( + Object.keys(legacyConfig.rules || {}).filter( + ruleName => + ruleName.startsWith('@typescript-eslint/') && hasCurrentTsRule(ruleName), + ), +); + const noopRule = { meta: { type: 'problem', docs: {}, schema: [] }, create: () => ({}), @@ -42,7 +55,7 @@ function normalizeConfig(config) { if (!ruleName.startsWith('@typescript-eslint/')) { return true; } - return recommendedTsRules.has(ruleName); + return recommendedTsRules.has(ruleName) || localTsRules.has(ruleName); }), ); } @@ -77,7 +90,7 @@ export default [ }, }, }, - ...compat.config(require('./.eslintrc.js')).map(normalizeConfig), + ...compat.config(legacyConfig).map(normalizeConfig), { rules: { '@typescript-eslint/no-empty-object-type': 'off', From e695b8c82f5bc94b97be48c5fef042a3479cdd30 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 13:22:18 +0800 Subject: [PATCH 10/18] docs: use ut install for local setup --- README.md | 4 ++-- README.zh-CN.md | 4 ++-- vercel.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e53dfc..65e156e 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ export default ({ keys }: { keys: string[] }) => ( Run the local dumi site: ```bash -npm install +ut install npm start ``` @@ -125,7 +125,7 @@ Then open `http://localhost:8000`. ## Development ```bash -npm install +ut install npm start npm test npm run tsc diff --git a/README.zh-CN.md b/README.zh-CN.md index 7cc6446..1630547 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,7 +65,7 @@ export default ({ keys }: { keys: string[] }) => ( 运葌本地 dumi η«™η‚ΉοΌš ```bash -npm install +ut install npm start ``` @@ -125,7 +125,7 @@ npm start ## ζœ¬εœ°εΌ€ε‘ ```bash -npm install +ut install npm start npm test npm run tsc diff --git a/vercel.json b/vercel.json index 5f9139e..20b1714 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,6 @@ { "framework": "umijs", - "installCommand": "npm install", + "installCommand": "ut install", "buildCommand": "npm run build", "outputDirectory": "docs-dist" } From 3f929a039ae8e84513028b5f66b7c6a44b255b16 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 13:29:46 +0800 Subject: [PATCH 11/18] chore: restore vercel install command --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 20b1714..5f9139e 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,6 @@ { "framework": "umijs", - "installCommand": "ut install", + "installCommand": "npm install", "buildCommand": "npm run build", "outputDirectory": "docs-dist" } From 349564a058ad4ad543de3931977d688bd86cef2a Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 14:02:20 +0800 Subject: [PATCH 12/18] chore: align maintenance dependencies --- eslint.config.mjs | 3 +++ package.json | 16 ++++++++-------- react-compat.d.ts | 14 -------------- src/CSSMotion.tsx | 2 +- src/hooks/useDomMotionEvents.ts | 2 +- tsconfig.json | 9 +-------- 6 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 react-compat.d.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index bedc35b..17c364c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -52,6 +52,9 @@ function normalizeConfig(config) { if (next.rules) { next.rules = Object.fromEntries( Object.entries(next.rules).filter(([ruleName]) => { + if (ruleName.startsWith('@babel/')) { + return false; + } if (!ruleName.startsWith('@typescript-eslint/')) { return true; } diff --git a/package.json b/package.json index 4a55122..13fd12b 100644 --- a/package.json +++ b/package.json @@ -65,30 +65,30 @@ "@types/node": "^26.0.1", "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", - "@typescript-eslint/eslint-plugin": "^8.62.0", - "@typescript-eslint/parser": "^8.62.0", + "@typescript-eslint/eslint-plugin": "^8.62.1", + "@typescript-eslint/parser": "^8.62.1", "@umijs/fabric": "^4.0.1", "cross-env": "^10.1.0", - "dumi": "^2.4.35", + "dumi": "^2.4.38", "eslint": "^9.39.4", "eslint-config-prettier": "^10.1.8", - "eslint-plugin-jest": "^29.15.3", + "eslint-plugin-jest": "^29.15.4", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-unicorn": "^65.0.1", - "father": "^4.6.23", + "father": "^4.6.24", "gh-pages": "^6.3.0", "husky": "^9.1.7", "lint-staged": "^17.0.8", - "prettier": "^3.9.0", + "prettier": "^3.9.4", "rc-test": "^7.1.3", "react": "^19.2.7", "react-dom": "^19.2.7", "typescript": "^6.0.3" }, "peerDependencies": { - "react": ">=16.9.0", - "react-dom": ">=16.9.0" + "react": "^19.2.7", + "react-dom": "^19.2.7" }, "cnpm": { "mode": "npm" diff --git a/react-compat.d.ts b/react-compat.d.ts deleted file mode 100644 index 9650edc..0000000 --- a/react-compat.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; - -declare module 'react' { - type ReactText = string | number; - function useRef(): React.MutableRefObject; - function isValidElement

( - object: {} | null | undefined, - ): object is React.ReactElement

; - function cloneElement

( - element: React.ReactElement

, - props?: (Partial

& React.Attributes) | null, - ...children: React.ReactNode[] - ): React.ReactElement

; -} diff --git a/src/CSSMotion.tsx b/src/CSSMotion.tsx index f23148b..20d9d32 100644 --- a/src/CSSMotion.tsx +++ b/src/CSSMotion.tsx @@ -148,7 +148,7 @@ export function genCSSMotion(config: CSSMotionConfig) { const supportMotion = isSupportTransition(props, contextMotion); // Ref to the react node, it may be a HTMLElement - const nodeRef = useRef(); + const nodeRef = useRef(null); function getDomElement() { return getDOM(nodeRef.current) as HTMLElement; diff --git a/src/hooks/useDomMotionEvents.ts b/src/hooks/useDomMotionEvents.ts index 16abd2c..3f4abe2 100644 --- a/src/hooks/useDomMotionEvents.ts +++ b/src/hooks/useDomMotionEvents.ts @@ -7,7 +7,7 @@ import { animationEndName, transitionEndName } from '../util/motion'; export default ( onInternalMotionEnd: (event: MotionEvent) => void, ): [(element: HTMLElement) => void, (element: HTMLElement) => void] => { - const cacheElementRef = useRef(); + const cacheElementRef = useRef(undefined); // Remove events function removeMotionEvents(element: HTMLElement) { diff --git a/tsconfig.json b/tsconfig.json index b894dcb..fbf456c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,13 +21,6 @@ "strictBindCallApply": false, "module": "ESNext" }, - "include": [ - "react-compat.d.ts", - "global.d.ts", - "src", - "docs", - ".dumirc.ts", - ".fatherrc.ts" - ], + "include": ["global.d.ts", "src", "docs", ".dumirc.ts", ".fatherrc.ts"], "exclude": ["node_modules", "lib", "es", "dist", "docs-dist"] } From 8157600b77a8a88ac2585db584b2a0ede3515329 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 14:24:27 +0800 Subject: [PATCH 13/18] chore: fix upgraded test tooling --- tests/__snapshots__/CSSMotion.spec.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__snapshots__/CSSMotion.spec.tsx.snap b/tests/__snapshots__/CSSMotion.spec.tsx.snap index c198b8b..f534cfe 100644 --- a/tests/__snapshots__/CSSMotion.spec.tsx.snap +++ b/tests/__snapshots__/CSSMotion.spec.tsx.snap @@ -1,3 +1,3 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`CSSMotion transition not crash when no children 1`] = `null`; From 1ac5310b4f999e5f4ffdda4b16128214558dd6e8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 14:34:37 +0800 Subject: [PATCH 14/18] fix: preserve React peer dependency range --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 13fd12b..0489b6b 100644 --- a/package.json +++ b/package.json @@ -87,8 +87,8 @@ "typescript": "^6.0.3" }, "peerDependencies": { - "react": "^19.2.7", - "react-dom": "^19.2.7" + "react": ">=16.9.0", + "react-dom": ">=16.9.0" }, "cnpm": { "mode": "npm" From f964862dc22d5160f5bc2d699d44d5a5dad168c0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 18:36:22 +0800 Subject: [PATCH 15/18] docs: use npm install in README --- README.md | 4 ++-- README.zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 65e156e..9e53dfc 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ export default ({ keys }: { keys: string[] }) => ( Run the local dumi site: ```bash -ut install +npm install npm start ``` @@ -125,7 +125,7 @@ Then open `http://localhost:8000`. ## Development ```bash -ut install +npm install npm start npm test npm run tsc diff --git a/README.zh-CN.md b/README.zh-CN.md index 1630547..7cc6446 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,7 +65,7 @@ export default ({ keys }: { keys: string[] }) => ( 运葌本地 dumi η«™η‚ΉοΌš ```bash -ut install +npm install npm start ``` @@ -125,7 +125,7 @@ npm start ## ζœ¬εœ°εΌ€ε‘ ```bash -ut install +npm install npm start npm test npm run tsc From d0372b727209461b2ad064508d5b3cad73c0bf37 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 18:46:36 +0800 Subject: [PATCH 16/18] chore: remove redundant strict tsconfig flags --- tsconfig.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index fbf456c..3f024eb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,13 +12,7 @@ "@rc-component/motion": ["./src/index.tsx"], "rc-motion": ["./src/index.tsx"] }, - "noImplicitAny": false, - "strictNullChecks": false, - "strictPropertyInitialization": false, - "strictFunctionTypes": false, "strict": false, - "noImplicitThis": false, - "strictBindCallApply": false, "module": "ESNext" }, "include": ["global.d.ts", "src", "docs", ".dumirc.ts", ".fatherrc.ts"], From 0eda310cf660cb3ee97c70fd54b2707326ffd5cb Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 1 Jul 2026 19:13:08 +0800 Subject: [PATCH 17/18] chore: remove manual global test declarations --- global.d.ts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/global.d.ts b/global.d.ts index bb2b627..e0bd355 100644 --- a/global.d.ts +++ b/global.d.ts @@ -8,31 +8,4 @@ declare module '*.css'; declare module '*.less'; declare module 'jsonp'; -declare namespace JSX { - type Element = React.JSX.Element; - interface ElementClass extends React.JSX.ElementClass {} - interface ElementAttributesProperty - extends React.JSX.ElementAttributesProperty {} - interface ElementChildrenAttribute - extends React.JSX.ElementChildrenAttribute {} - type LibraryManagedAttributes = React.JSX.LibraryManagedAttributes< - C, - P - >; - interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {} - interface IntrinsicClassAttributes extends React.JSX - .IntrinsicClassAttributes {} - interface IntrinsicElements extends React.JSX.IntrinsicElements {} -} - -declare namespace jest { - interface Matchers { - lastCalledWith(...expected: unknown[]): R; - nthCalledWith(nthCall: number, ...expected: unknown[]): R; - toBeCalled(): R; - toBeCalledTimes(expected: number): R; - toBeCalledWith(...expected: unknown[]): R; - } -} - declare module 'moment/locale/zh-cn'; From 0ecfb4b022aee8b45ef24f6075c6eaa9f54a8738 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 2 Jul 2026 11:54:02 +0800 Subject: [PATCH 18/18] chore: migrate to native eslint flat config --- .eslintrc.js | 14 ---- eslint.config.mjs | 159 ++++++++++++++++++++++++---------------------- package.json | 11 +--- 3 files changed, 86 insertions(+), 98 deletions(-) delete mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 25c9491..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - extends: [require.resolve('@umijs/fabric/dist/eslint')], - rules: { - 'no-template-curly-in-string': 0, - 'prefer-promise-reject-errors': 0, - 'react/no-array-index-key': 0, - 'react/sort-comp': 0, - '@typescript-eslint/no-explicit-any': 0, - 'react/no-find-dom-node': 0, - 'jsx-a11y/label-has-for': 0, - 'jsx-a11y/label-has-associated-control': 0, - 'default-case': 0, - }, -}; diff --git a/eslint.config.mjs b/eslint.config.mjs index 17c364c..d19be2a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,72 +1,23 @@ -import { FlatCompat } from '@eslint/eslintrc'; import js from '@eslint/js'; -import tsEslintPlugin from '@typescript-eslint/eslint-plugin'; -import { createRequire } from 'node:module'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; +import { defineConfig } from 'eslint/config'; +import prettier from 'eslint-config-prettier'; +import jest from 'eslint-plugin-jest'; +import react from 'eslint-plugin-react'; +import reactHooks from 'eslint-plugin-react-hooks'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const require = createRequire(import.meta.url); - -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all, -}); - -const legacyConfig = require('./.eslintrc.js'); -const recommendedTsRulesConfig = tsEslintPlugin.configs.recommended; -const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig) - ? recommendedTsRulesConfig.reduce( - (rules, config) => ({ ...rules, ...(config.rules || {}) }), - {}, - ) - : recommendedTsRulesConfig?.rules || {}; -const recommendedTsRules = new Set(Object.keys(recommendedTsRulesObject)); - -function hasCurrentTsRule(ruleName) { - const tsRuleName = ruleName.replace('@typescript-eslint/', ''); - return Boolean(tsEslintPlugin.rules[tsRuleName]); -} -const localTsRules = new Set( - Object.keys(legacyConfig.rules || {}).filter( - ruleName => - ruleName.startsWith('@typescript-eslint/') && hasCurrentTsRule(ruleName), - ), -); - -const noopRule = { - meta: { type: 'problem', docs: {}, schema: [] }, - create: () => ({}), -}; - -function normalizeConfig(config) { - const next = { ...config }; - - if (next.plugins?.['@typescript-eslint']) { - next.plugins = { ...next.plugins }; - delete next.plugins['@typescript-eslint']; - } - - if (next.rules) { - next.rules = Object.fromEntries( - Object.entries(next.rules).filter(([ruleName]) => { - if (ruleName.startsWith('@babel/')) { - return false; - } - if (!ruleName.startsWith('@typescript-eslint/')) { - return true; - } - return recommendedTsRules.has(ruleName) || localTsRules.has(ruleName); - }), - ); - } - - return next; -} - -export default [ +export default defineConfig([ + { + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + }, + { + linterOptions: { + reportUnusedDisableDirectives: 'off', + }, + }, { ignores: [ 'node_modules/', @@ -78,27 +29,83 @@ export default [ '.dumi/', '.doc/', '.vercel/', - '.eslintrc.js', 'src/index.d.ts', ], }, { + files: ['**/*.{js,jsx,ts,tsx}'], + extends: [ + js.configs.recommended, + react.configs.flat.recommended, + react.configs.flat['jsx-runtime'], + prettier, + ], plugins: { - '@typescript-eslint': { - ...tsEslintPlugin, - rules: { - ...tsEslintPlugin.rules, - 'consistent-type-exports': noopRule, - }, + 'react-hooks': reactHooks, + }, + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + }, + settings: { + react: { + version: 'detect', }, }, + rules: { + 'no-async-promise-executor': 'off', + 'no-empty-pattern': 'off', + 'no-irregular-whitespace': 'off', + 'no-prototype-builtins': 'off', + 'no-useless-escape': 'off', + 'no-extra-boolean-cast': 'off', + 'no-undef': 'off', + 'no-unused-vars': 'off', + 'react/no-find-dom-node': 'off', + 'react/display-name': 'off', + 'react/no-unknown-property': 'off', + 'react/prop-types': 'off', + 'react-hooks/exhaustive-deps': 'warn', + 'react-hooks/rules-of-hooks': 'error', + }, }, - ...compat.config(legacyConfig).map(normalizeConfig), { + files: ['**/*.{ts,tsx}'], + extends: [...tseslint.configs.recommended], rules: { + '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-unnecessary-type-constraint': 'off', '@typescript-eslint/no-unused-vars': 'off', }, }, -]; + { + files: ['src/**/*.{ts,tsx}'], + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + }, + { + files: ['tests/**/*.{js,jsx,ts,tsx}', '**/*.{test,spec}.{js,jsx,ts,tsx}'], + extends: [jest.configs['flat/recommended']], + rules: { + 'jest/no-disabled-tests': 'off', + 'jest/no-done-callback': 'off', + 'jest/no-identical-title': 'off', + 'jest/expect-expect': 'off', + 'jest/no-alias-methods': 'off', + 'jest/no-conditional-expect': 'off', + 'jest/no-export': 'off', + 'jest/no-standalone-expect': 'off', + 'jest/valid-expect': 'off', + 'jest/valid-title': 'off', + }, + }, +]); diff --git a/package.json b/package.json index 0489b6b..44b5c41 100644 --- a/package.json +++ b/package.json @@ -52,9 +52,6 @@ "clsx": "^2.1.1" }, "devDependencies": { - "@babel/eslint-parser": "^7.29.7", - "@babel/eslint-plugin": "^7.29.7", - "@eslint/eslintrc": "^3.3.5", "@eslint/js": "^9.39.4", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", @@ -65,9 +62,6 @@ "@types/node": "^26.0.1", "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", - "@typescript-eslint/eslint-plugin": "^8.62.1", - "@typescript-eslint/parser": "^8.62.1", - "@umijs/fabric": "^4.0.1", "cross-env": "^10.1.0", "dumi": "^2.4.38", "eslint": "^9.39.4", @@ -75,16 +69,17 @@ "eslint-plugin-jest": "^29.15.4", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", - "eslint-plugin-unicorn": "^65.0.1", "father": "^4.6.24", "gh-pages": "^6.3.0", + "globals": "^17.7.0", "husky": "^9.1.7", "lint-staged": "^17.0.8", "prettier": "^3.9.4", "rc-test": "^7.1.3", "react": "^19.2.7", "react-dom": "^19.2.7", - "typescript": "^6.0.3" + "typescript": "^6.0.3", + "typescript-eslint": "^8.62.1" }, "peerDependencies": { "react": ">=16.9.0",