Skip to content

Commit 39fe6d4

Browse files
committed
chore: update maintenance dependencies
1 parent 4c0ecd9 commit 39fe6d4

8 files changed

Lines changed: 217 additions & 31 deletions

File tree

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ updates:
88
time: '21:00'
99
timezone: Asia/Shanghai
1010
open-pull-requests-limit: 10
11+
groups:
12+
npm-dependencies:
13+
patterns:
14+
- '*'
1115

1216
- package-ecosystem: github-actions
1317
directory: '/'
@@ -17,3 +21,7 @@ updates:
1721
time: '21:00'
1822
timezone: Asia/Shanghai
1923
open-pull-requests-limit: 10
24+
groups:
25+
github-actions:
26+
patterns:
27+
- '*'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1>@rc-component/motion</h1>
3-
<p><sub><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /> Part of the Ant Design ecosystem.</sub></p>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Part of the Ant Design ecosystem.</sub></p>
44
<p>🎞️ Lifecycle-driven motion primitives for React enter, leave, and list animations.</p>
55

66
<p>

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22
<h1>@rc-component/motion</h1>
3-
<p><sub><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /> Ant Design 生态的一部分。</sub></p>
3+
<p><sub><a href="https://ant.design"><img alt="Ant Design" height="14" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="vertical-align: -0.125em;" /></a> Ant Design 生态的一部分。</sub></p>
44
<p>🎞️ React 动效基础组件,封装 CSS 动画、过渡和生命周期状态。</p>
55

66
<p>

eslint.config.mjs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import js from '@eslint/js';
3+
import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
4+
import { createRequire } from 'node:module';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const require = createRequire(import.meta.url);
11+
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
const recommendedTsRules = new Set(
19+
Object.keys(tsEslintPlugin.configs.recommended.rules || {}),
20+
);
21+
const noopRule = {
22+
meta: { type: 'problem', docs: {}, schema: [] },
23+
create: () => ({}),
24+
};
25+
26+
function normalizeConfig(config) {
27+
const next = { ...config };
28+
29+
if (next.plugins?.['@typescript-eslint']) {
30+
next.plugins = {
31+
...next.plugins,
32+
'@typescript-eslint': {
33+
...next.plugins['@typescript-eslint'],
34+
rules: {
35+
...next.plugins['@typescript-eslint'].rules,
36+
'ban-types': noopRule,
37+
},
38+
},
39+
};
40+
}
41+
42+
if (next.rules) {
43+
next.rules = Object.fromEntries(
44+
Object.entries(next.rules).filter(([ruleName]) => {
45+
if (!ruleName.startsWith('@typescript-eslint/')) {
46+
return true;
47+
}
48+
return (
49+
recommendedTsRules.has(ruleName) ||
50+
ruleName === '@typescript-eslint/ban-types'
51+
);
52+
}),
53+
);
54+
}
55+
56+
return next;
57+
}
58+
59+
export default [
60+
{
61+
ignores: [
62+
'node_modules/',
63+
'coverage/',
64+
'es/',
65+
'lib/',
66+
'dist/',
67+
'docs-dist/',
68+
'.dumi/',
69+
'.doc/',
70+
'.vercel/',
71+
'.eslintrc.js',
72+
'src/index.d.ts',
73+
],
74+
},
75+
...compat.config(require('./.eslintrc.js')).map(normalizeConfig),
76+
{
77+
rules: {
78+
'@typescript-eslint/ban-types': 'off',
79+
'@typescript-eslint/no-empty-object-type': 'off',
80+
'@typescript-eslint/no-unsafe-function-type': 'off',
81+
'@typescript-eslint/no-unused-vars': 'off',
82+
},
83+
},
84+
];

global.d.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/// <reference types="jest" />
2+
/// <reference types="node" />
3+
/// <reference types="react" />
4+
/// <reference types="react-dom" />
5+
/// <reference types="@testing-library/jest-dom" />
6+
7+
declare module '*.css';
8+
declare module '*.less';
9+
declare module 'jsonp';
10+
11+
declare namespace JSX {
12+
type Element = React.JSX.Element;
13+
interface ElementClass extends React.JSX.ElementClass {}
14+
interface ElementAttributesProperty
15+
extends React.JSX.ElementAttributesProperty {}
16+
interface ElementChildrenAttribute
17+
extends React.JSX.ElementChildrenAttribute {}
18+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<
19+
C,
20+
P
21+
>;
22+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
23+
interface IntrinsicClassAttributes<T> extends React.JSX
24+
.IntrinsicClassAttributes<T> {}
25+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
26+
}
27+
28+
declare namespace jest {
29+
interface Matchers<R> {
30+
lastCalledWith(...expected: unknown[]): R;
31+
nthCalledWith(nthCall: number, ...expected: unknown[]): R;
32+
toBeCalled(): R;
33+
toBeCalledTimes(expected: number): R;
34+
toBeCalledWith(...expected: unknown[]): R;
35+
}
36+
}
37+
38+
declare const vi: {
39+
fn: <T extends (...args: any[]) => any = (...args: any[]) => any>(
40+
implementation?: T,
41+
) => jest.MockedFunction<T>;
42+
mock: (
43+
moduleName: string,
44+
factory?: (importOriginal: <T>() => Promise<T>) => unknown,
45+
) => void;
46+
spyOn: typeof jest.spyOn;
47+
useFakeTimers: () => void;
48+
useRealTimers: () => void;
49+
advanceTimersByTime: (msToRun: number) => void;
50+
clearAllTimers: () => void;
51+
runAllTimers: () => void;
52+
importActual: <T>(moduleName: string) => Promise<T>;
53+
clearAllMocks: () => void;
54+
resetAllMocks: () => void;
55+
restoreAllMocks: () => void;
56+
};
57+
58+
declare const describe: any;
59+
declare const it: any;
60+
declare const test: any;
61+
declare const beforeEach: any;
62+
declare const afterEach: any;
63+
declare const beforeAll: any;
64+
declare const afterAll: any;
65+
declare const expect: any;
66+
67+
declare module 'moment/locale/zh-cn';

package.json

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,35 @@
5555
"@rc-component/father-plugin": "^2.2.0",
5656
"@rc-component/np": "^1.0.4",
5757
"@testing-library/jest-dom": "^6.9.1",
58-
"@testing-library/react": "^15.0.7",
59-
"@types/jest": "^29.5.14",
58+
"@testing-library/react": "^16.3.2",
59+
"@types/jest": "^30.0.0",
6060
"@types/node": "^26.0.1",
61-
"@types/react": "^18.3.31",
62-
"@types/react-dom": "^18.3.7",
61+
"@types/react": "^19.2.17",
62+
"@types/react-dom": "^19.2.3",
6363
"@umijs/fabric": "^4.0.1",
6464
"cross-env": "^10.1.0",
6565
"dumi": "^2.4.35",
66-
"eslint": "^8.57.1",
66+
"eslint": "^9.39.4",
6767
"father": "^4.6.23",
6868
"gh-pages": "^6.3.0",
6969
"husky": "^9.1.7",
70-
"lint-staged": "^16.4.0",
70+
"lint-staged": "^17.0.8",
7171
"prettier": "^3.9.0",
7272
"rc-test": "^7.1.3",
73-
"react": "^18.3.1",
74-
"react-dom": "^18.3.1",
75-
"typescript": "^5.9.3"
73+
"react": "^19.2.7",
74+
"react-dom": "^19.2.7",
75+
"typescript": "^6.0.3",
76+
"@eslint/eslintrc": "^3.3.5",
77+
"@eslint/js": "^9.39.4",
78+
"eslint-plugin-react": "^7.37.5",
79+
"eslint-plugin-react-hooks": "^7.1.1",
80+
"eslint-config-prettier": "^10.1.8",
81+
"@babel/eslint-parser": "^7.29.7",
82+
"@babel/eslint-plugin": "^7.29.7",
83+
"@typescript-eslint/eslint-plugin": "^8.62.0",
84+
"@typescript-eslint/parser": "^8.62.0",
85+
"eslint-plugin-jest": "^29.15.3",
86+
"eslint-plugin-unicorn": "^65.0.1"
7687
},
7788
"peerDependencies": {
7889
"react": ">=16.9.0",

react-compat.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as React from 'react';
2+
3+
declare module 'react' {
4+
type ReactText = string | number;
5+
function useRef<T = undefined>(): React.MutableRefObject<T | undefined>;
6+
function isValidElement<P = any>(
7+
object: {} | null | undefined,
8+
): object is React.ReactElement<P>;
9+
function cloneElement<P = any>(
10+
element: React.ReactElement<P>,
11+
props?: (Partial<P> & React.Attributes) | null,
12+
...children: React.ReactNode[]
13+
): React.ReactElement<P>;
14+
}
15+
16+
declare module 'react-dom' {
17+
function hydrate(
18+
element: React.ReactNode,
19+
container: Element | DocumentFragment,
20+
): void;
21+
}

tsconfig.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,27 @@
88
"skipLibCheck": true,
99
"esModuleInterop": true,
1010
"paths": {
11-
"@/*": [
12-
"src/*"
13-
],
14-
"@@/*": [
15-
".dumi/tmp/*"
16-
],
17-
"@rc-component/motion": [
18-
"src/index.tsx"
19-
],
20-
"rc-motion": [
21-
"src/index.tsx"
22-
]
11+
"@/*": ["src/*"],
12+
"@@/*": [".dumi/tmp/*"],
13+
"@rc-component/motion": ["src/index.tsx"],
14+
"rc-motion": ["src/index.tsx"]
2315
},
24-
"ignoreDeprecations": "5.0"
16+
"ignoreDeprecations": "6.0",
17+
"noImplicitAny": false,
18+
"strictNullChecks": false,
19+
"strictPropertyInitialization": false,
20+
"strictFunctionTypes": false,
21+
"strict": false,
22+
"noImplicitThis": false,
23+
"strictBindCallApply": false
2524
},
2625
"include": [
26+
"react-compat.d.ts",
27+
"global.d.ts",
2728
"src",
2829
"docs",
2930
".dumirc.ts",
3031
".fatherrc.ts"
3132
],
32-
"exclude": [
33-
"node_modules",
34-
"lib",
35-
"es",
36-
"dist",
37-
"docs-dist"
38-
]
33+
"exclude": ["node_modules", "lib", "es", "dist", "docs-dist"]
3934
}

0 commit comments

Comments
 (0)