Skip to content

Commit 54cb3b4

Browse files
committed
chore: update maintenance dependencies
1 parent 8c99b00 commit 54cb3b4

8 files changed

Lines changed: 217 additions & 29 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/input</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>📦 ⌨️ Low-level React input primitives for building polished text fields and textareas.</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/input</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 输入框基础组件,支持前后缀、清除按钮、计数和组合输入。</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: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,37 @@
5252
"@rc-component/father-plugin": "^2.2.0",
5353
"@rc-component/np": "^1.0.4",
5454
"@testing-library/jest-dom": "^6.9.1",
55-
"@testing-library/react": "^15.0.7",
56-
"@testing-library/user-event": "14.5.2",
57-
"@types/jest": "^29.5.14",
55+
"@testing-library/react": "^16.3.2",
56+
"@testing-library/user-event": "^14.6.1",
57+
"@types/jest": "^30.0.0",
5858
"@types/node": "^26.0.1",
59-
"@types/react": "^18.3.31",
60-
"@types/react-dom": "^18.3.7",
59+
"@types/react": "^19.2.17",
60+
"@types/react-dom": "^19.2.3",
6161
"@umijs/fabric": "^4.0.1",
6262
"cross-env": "^10.1.0",
6363
"dumi": "^2.4.35",
64-
"eslint": "^8.57.1",
64+
"eslint": "^9.39.4",
6565
"father": "^4.6.23",
6666
"gh-pages": "^6.3.0",
6767
"husky": "^9.1.7",
6868
"less": "^4.6.7",
69-
"lint-staged": "^16.4.0",
69+
"lint-staged": "^17.0.8",
7070
"prettier": "^3.9.0",
7171
"rc-test": "^7.1.3",
72-
"react": "^18.3.1",
73-
"react-dom": "^18.3.1",
74-
"typescript": "^5.9.3"
72+
"react": "^19.2.7",
73+
"react-dom": "^19.2.7",
74+
"typescript": "^6.0.3",
75+
"@eslint/eslintrc": "^3.3.5",
76+
"@eslint/js": "^9.39.4",
77+
"eslint-plugin-react": "^7.37.5",
78+
"eslint-plugin-react-hooks": "^7.1.1",
79+
"eslint-config-prettier": "^10.1.8",
80+
"@babel/eslint-parser": "^7.29.7",
81+
"@babel/eslint-plugin": "^7.29.7",
82+
"@typescript-eslint/eslint-plugin": "^8.62.0",
83+
"@typescript-eslint/parser": "^8.62.0",
84+
"eslint-plugin-jest": "^29.15.3",
85+
"eslint-plugin-unicorn": "^65.0.1"
7586
},
7687
"peerDependencies": {
7788
"react": ">=16.0.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: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,30 @@
44
"module": "ESNext",
55
"moduleResolution": "node",
66
"baseUrl": "./",
7-
"lib": [
8-
"dom",
9-
"es2017",
10-
"es2022",
11-
"esnext"
12-
],
7+
"lib": ["dom", "es2017", "es2022", "esnext"],
138
"jsx": "react",
14-
"strict": true,
9+
"strict": false,
1510
"esModuleInterop": true,
1611
"experimentalDecorators": true,
1712
"emitDecoratorMetadata": true,
1813
"skipLibCheck": true,
1914
"declaration": true,
2015
"paths": {
21-
"@/*": [
22-
"src/*"
23-
],
24-
"@@/*": [
25-
".dumi/tmp/*"
26-
],
27-
"@rc-component/input": [
28-
"src/index.tsx"
29-
]
16+
"@/*": ["src/*"],
17+
"@@/*": [".dumi/tmp/*"],
18+
"@rc-component/input": ["src/index.tsx"]
3019
},
31-
"ignoreDeprecations": "5.0"
20+
"ignoreDeprecations": "6.0",
21+
"noImplicitAny": false,
22+
"strictNullChecks": false,
23+
"strictPropertyInitialization": false,
24+
"strictFunctionTypes": false,
25+
"noImplicitThis": false,
26+
"strictBindCallApply": false
3227
},
3328
"include": [
29+
"react-compat.d.ts",
30+
"global.d.ts",
3431
".fatherrc.ts",
3532
".dumirc.ts",
3633
"**/*.ts",

0 commit comments

Comments
 (0)