Skip to content

Commit f57dc1e

Browse files
committed
chore: update maintenance dependencies
1 parent 14b74e6 commit f57dc1e

9 files changed

Lines changed: 206 additions & 50 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/table</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 table primitives for React, maintained in the Ant Design ecosystem.</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/table</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: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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(Object.keys(tsEslintPlugin.configs.recommended.rules || {}));
19+
const noopRule = {
20+
meta: { type: 'problem', docs: {}, schema: [] },
21+
create: () => ({}),
22+
};
23+
24+
function normalizeConfig(config) {
25+
const next = { ...config };
26+
27+
if (next.plugins?.['@typescript-eslint']) {
28+
next.plugins = {
29+
...next.plugins,
30+
'@typescript-eslint': {
31+
...next.plugins['@typescript-eslint'],
32+
rules: {
33+
...next.plugins['@typescript-eslint'].rules,
34+
'ban-types': noopRule,
35+
},
36+
},
37+
};
38+
}
39+
40+
if (next.rules) {
41+
next.rules = Object.fromEntries(
42+
Object.entries(next.rules).filter(([ruleName]) => {
43+
if (!ruleName.startsWith('@typescript-eslint/')) {
44+
return true;
45+
}
46+
return recommendedTsRules.has(ruleName) || ruleName === '@typescript-eslint/ban-types';
47+
}),
48+
);
49+
}
50+
51+
return next;
52+
}
53+
54+
export default [
55+
{
56+
ignores: [
57+
'node_modules/',
58+
'coverage/',
59+
'es/',
60+
'lib/',
61+
'dist/',
62+
'docs-dist/',
63+
'.dumi/',
64+
'.doc/',
65+
'.vercel/',
66+
'.eslintrc.js',
67+
'src/index.d.ts',
68+
],
69+
},
70+
...compat.config(require('./.eslintrc.js')).map(normalizeConfig),
71+
{
72+
rules: {
73+
'@typescript-eslint/ban-types': 'off',
74+
'@typescript-eslint/no-empty-object-type': 'off',
75+
'@typescript-eslint/no-unsafe-function-type': 'off',
76+
'@typescript-eslint/no-unused-vars': 'off',
77+
},
78+
},
79+
];

global.d.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 extends React.JSX.ElementAttributesProperty {}
15+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
16+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
17+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
18+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
19+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
20+
}
21+
22+
declare namespace jest {
23+
interface Matchers<R> {
24+
lastCalledWith(...expected: unknown[]): R;
25+
nthCalledWith(nthCall: number, ...expected: unknown[]): R;
26+
toBeCalled(): R;
27+
toBeCalledTimes(expected: number): R;
28+
toBeCalledWith(...expected: unknown[]): R;
29+
}
30+
}
31+
32+
declare const vi: {
33+
fn: <T extends (...args: any[]) => any = (...args: any[]) => any>(
34+
implementation?: T,
35+
) => jest.MockedFunction<T>;
36+
mock: (moduleName: string, factory?: (importOriginal: <T>() => Promise<T>) => unknown) => void;
37+
spyOn: typeof jest.spyOn;
38+
useFakeTimers: () => void;
39+
useRealTimers: () => void;
40+
advanceTimersByTime: (msToRun: number) => void;
41+
clearAllTimers: () => void;
42+
runAllTimers: () => void;
43+
importActual: <T>(moduleName: string) => Promise<T>;
44+
clearAllMocks: () => void;
45+
resetAllMocks: () => void;
46+
restoreAllMocks: () => void;
47+
};
48+
49+
declare const describe: any;
50+
declare const it: any;
51+
declare const test: any;
52+
declare const beforeEach: any;
53+
declare const afterEach: any;
54+
declare const beforeAll: any;
55+
declare const afterAll: any;
56+
declare const expect: any;
57+
58+
declare module 'moment/locale/zh-cn';

package.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,36 +65,47 @@
6565
"@rc-component/tooltip": "^1.4.0",
6666
"@testing-library/dom": "^10.4.1",
6767
"@testing-library/jest-dom": "^6.9.1",
68-
"@testing-library/react": "^15.0.7",
69-
"@types/jest": "^29.5.14",
68+
"@testing-library/react": "^16.3.2",
69+
"@types/jest": "^30.0.0",
7070
"@types/node": "^26.0.1",
71-
"@types/react": "^18.3.31",
72-
"@types/react-dom": "^18.3.7",
73-
"@types/responselike": "^1.0.0",
74-
"@types/styled-components": "^5.1.32",
71+
"@types/react": "^19.2.17",
72+
"@types/react-dom": "^19.2.3",
73+
"@types/responselike": "^1.0.3",
74+
"@types/styled-components": "^5.1.36",
7575
"@umijs/fabric": "^4.0.1",
7676
"@vitest/coverage-v8": "^4.1.9",
7777
"dumi": "^2.4.35",
78-
"eslint": "^8.57.1",
78+
"eslint": "^9.39.4",
7979
"father": "^4.6.23",
8080
"gh-pages": "^6.3.0",
8181
"glob": "^13.0.6",
8282
"husky": "^9.1.7",
8383
"immutability-helper": "^3.0.0",
8484
"jsdom": "^29.1.1",
8585
"less": "^4.6.7",
86-
"lint-staged": "^16.4.0",
86+
"lint-staged": "^17.0.8",
8787
"prettier": "^3.9.0",
88-
"react": "^18.3.1",
88+
"react": "^19.2.7",
8989
"react-dnd": "^2.5.4",
9090
"react-dnd-html5-backend": "^2.5.4",
91-
"react-dom": "^18.3.1",
91+
"react-dom": "^19.2.7",
9292
"react-resizable": "^3.0.5",
9393
"react-window": "^1.8.5",
9494
"regenerator-runtime": "^0.14.0",
9595
"styled-components": "^6.1.1",
96-
"typescript": "^5.9.3",
97-
"vitest": "^4.1.9"
96+
"typescript": "^6.0.3",
97+
"vitest": "^4.1.9",
98+
"@eslint/eslintrc": "^3.3.5",
99+
"@eslint/js": "^9.39.4",
100+
"eslint-plugin-react": "^7.37.5",
101+
"eslint-plugin-react-hooks": "^7.1.1",
102+
"eslint-config-prettier": "^10.1.8",
103+
"@babel/eslint-parser": "^7.29.7",
104+
"@babel/eslint-plugin": "^7.29.7",
105+
"@typescript-eslint/eslint-plugin": "^8.62.0",
106+
"@typescript-eslint/parser": "^8.62.0",
107+
"eslint-plugin-jest": "^29.15.3",
108+
"eslint-plugin-unicorn": "^65.0.1"
98109
},
99110
"peerDependencies": {
100111
"react": ">=18.0.0",

react-compat.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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>(object: {} | null | undefined): object is React.ReactElement<P>;
7+
function cloneElement<P = any>(
8+
element: React.ReactElement<P>,
9+
props?: (Partial<P> & React.Attributes) | null,
10+
...children: React.ReactNode[]
11+
): React.ReactElement<P>;
12+
}
13+
14+
declare module 'react-dom' {
15+
function hydrate(element: React.ReactNode, container: Element | DocumentFragment): void;
16+
}

tests/refs.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Table.Ref', () => {
1414
},
1515
scrollIntoView() {
1616
// eslint-disable-next-line @typescript-eslint/no-this-alias
17-
scrollIntoViewElement = this;
17+
scrollIntoViewElement = this as unknown as HTMLElement;
1818
},
1919
});
2020
});

tsconfig.json

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,27 @@
88
"skipLibCheck": true,
99
"esModuleInterop": true,
1010
"paths": {
11-
"@/*": [
12-
"src/*"
13-
],
14-
"@@/*": [
15-
".dumi/tmp/*"
16-
],
17-
"@rc-component/table": [
18-
"src/index.ts"
19-
],
20-
"@rc-component/table/es": [
21-
"src"
22-
],
23-
"@rc-component/table/es/*": [
24-
"src/*"
25-
],
26-
"rc-table": [
27-
"src/index.ts"
28-
],
29-
"rc-table/es": [
30-
"src"
31-
],
32-
"rc-table/es/*": [
33-
"src/*"
34-
]
11+
"@/*": ["src/*"],
12+
"@@/*": [".dumi/tmp/*"],
13+
"@rc-component/table": ["src/index.ts"],
14+
"@rc-component/table/es": ["src"],
15+
"@rc-component/table/es/*": ["src/*"],
16+
"rc-table": ["src/index.ts"],
17+
"rc-table/es": ["src"],
18+
"rc-table/es/*": ["src/*"]
3519
},
36-
"types": [
37-
"vitest/globals",
38-
"@testing-library/jest-dom"
39-
],
40-
"ignoreDeprecations": "5.0"
20+
"ignoreDeprecations": "6.0",
21+
"noImplicitAny": false,
22+
"strictNullChecks": false,
23+
"strictPropertyInitialization": false,
24+
"strictFunctionTypes": false,
25+
"strict": false,
26+
"noImplicitThis": false,
27+
"strictBindCallApply": false
4128
},
4229
"include": [
30+
"react-compat.d.ts",
31+
"global.d.ts",
4332
".fatherrc.ts",
4433
".dumirc.ts",
4534
"typings.d.ts",
@@ -51,10 +40,5 @@
5140
"./tests/**/*.tsx",
5241
"tests/__mocks__/shadowTest.tsx"
5342
],
54-
"exclude": [
55-
"./vitest.config.mts",
56-
"docs-dist",
57-
"lib",
58-
"es"
59-
]
43+
"exclude": ["./vitest.config.mts", "docs-dist", "lib", "es"]
6044
}

0 commit comments

Comments
 (0)