Skip to content

Commit 717f99f

Browse files
authored
chore: update maintenance dependencies (#709)
* chore: update maintenance dependencies * fix: align TypeScript and ESLint compatibility * chore: use testing-library dom events * test: keep react testing event behavior * chore: address review comments * fix: keep compatible eslint export rule * chore: preserve local eslint rule overrides * docs: use ut install for local setup * chore: restore vercel install command * chore: align maintenance dependencies * chore: fix upgraded test tooling * fix: preserve React peer dependency range * docs: use npm install in README * chore: remove redundant strict tsconfig flags * chore: remove manual global test declarations * chore: migrate to native eslint flat config * chore: address review comments
1 parent b791e7a commit 717f99f

12 files changed

Lines changed: 176 additions & 39 deletions

.eslintrc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

.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/pagination</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>📄 React pagination primitives for page navigation, size changing, quick jumping, and locale-aware controls.</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/pagination</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: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import js from '@eslint/js';
2+
import { defineConfig } from 'eslint/config';
3+
import { dirname } from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import prettier from 'eslint-config-prettier';
6+
import jest from 'eslint-plugin-jest';
7+
import react from 'eslint-plugin-react';
8+
import reactHooks from 'eslint-plugin-react-hooks';
9+
import globals from 'globals';
10+
import tseslint from 'typescript-eslint';
11+
12+
const tsconfigRootDir = dirname(fileURLToPath(import.meta.url));
13+
14+
export default defineConfig([
15+
{
16+
plugins: {
17+
'@typescript-eslint': tseslint.plugin,
18+
},
19+
},
20+
{
21+
linterOptions: {
22+
reportUnusedDisableDirectives: 'warn',
23+
},
24+
},
25+
{
26+
ignores: [
27+
'node_modules/',
28+
'coverage/',
29+
'es/',
30+
'lib/',
31+
'dist/',
32+
'docs-dist/',
33+
'.docs-dist/',
34+
'.dumi/',
35+
'.doc/',
36+
'.vercel/',
37+
'src/locale/*.js',
38+
],
39+
},
40+
{
41+
files: ['**/*.{js,jsx,ts,tsx}'],
42+
extends: [
43+
js.configs.recommended,
44+
react.configs.flat.recommended,
45+
react.configs.flat['jsx-runtime'],
46+
prettier,
47+
],
48+
plugins: {
49+
'react-hooks': reactHooks,
50+
},
51+
languageOptions: {
52+
globals: {
53+
...globals.browser,
54+
...globals.node,
55+
},
56+
},
57+
settings: {
58+
react: {
59+
version: 'detect',
60+
},
61+
},
62+
rules: {
63+
'no-async-promise-executor': 'off',
64+
'no-empty-pattern': 'off',
65+
'no-irregular-whitespace': 'off',
66+
'no-prototype-builtins': 'off',
67+
'no-useless-escape': 'off',
68+
'no-extra-boolean-cast': 'off',
69+
'no-undef': 'off',
70+
'no-unused-vars': 'off',
71+
'react/no-find-dom-node': 'off',
72+
'react/display-name': 'off',
73+
'react/no-unknown-property': 'off',
74+
'react/prop-types': 'off',
75+
'react-hooks/exhaustive-deps': 'warn',
76+
'react-hooks/rules-of-hooks': 'error',
77+
},
78+
},
79+
{
80+
files: ['**/*.{ts,tsx}'],
81+
extends: [...tseslint.configs.recommended],
82+
rules: {
83+
'@typescript-eslint/ban-ts-comment': 'off',
84+
'@typescript-eslint/no-empty-object-type': 'off',
85+
'@typescript-eslint/no-explicit-any': 'off',
86+
'@typescript-eslint/no-unsafe-function-type': 'off',
87+
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
88+
'@typescript-eslint/no-unused-vars': 'off',
89+
},
90+
},
91+
{
92+
files: ['src/**/*.{ts,tsx}'],
93+
languageOptions: {
94+
parserOptions: {
95+
projectService: true,
96+
tsconfigRootDir,
97+
},
98+
},
99+
},
100+
{
101+
files: ['tests/**/*.{js,jsx,ts,tsx}', '**/*.{test,spec}.{js,jsx,ts,tsx}'],
102+
extends: [jest.configs['flat/recommended']],
103+
rules: {
104+
'jest/no-disabled-tests': 'off',
105+
'jest/no-done-callback': 'off',
106+
'jest/no-identical-title': 'off',
107+
'jest/expect-expect': 'off',
108+
'jest/no-alias-methods': 'off',
109+
'jest/no-conditional-expect': 'off',
110+
'jest/no-export': 'off',
111+
'jest/no-standalone-expect': 'off',
112+
'jest/valid-expect': 'off',
113+
'jest/valid-title': 'off',
114+
},
115+
},
116+
]);

global.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 module 'moment/locale/zh-cn';

package.json

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,32 +71,39 @@
7171
"clsx": "^2.1.1"
7272
},
7373
"devDependencies": {
74+
"@eslint/js": "^9.39.4",
7475
"@rc-component/father-plugin": "^2.2.0",
7576
"@rc-component/np": "^1.0.4",
77+
"@rc-component/select": "^1.8.0",
78+
"@testing-library/dom": "^10.4.1",
7679
"@testing-library/jest-dom": "^6.9.1",
77-
"@testing-library/react": "^15.0.7",
78-
"@testing-library/user-event": "14.5.2",
79-
"@types/jest": "^29.5.14",
80+
"@testing-library/react": "^16.3.2",
81+
"@testing-library/user-event": "^14.6.1",
82+
"@types/jest": "^30.0.0",
8083
"@types/node": "^26.0.1",
81-
"@types/react": "^18.3.31",
82-
"@types/react-dom": "^18.3.7",
83-
"@umijs/fabric": "^4.0.1",
84+
"@types/react": "^19.2.17",
85+
"@types/react-dom": "^19.2.3",
8486
"cross-env": "^10.1.0",
85-
"dumi": "^2.4.35",
86-
"eslint": "^8.57.1",
87-
"father": "^4.6.23",
87+
"dumi": "^2.4.38",
88+
"eslint": "^9.39.4",
89+
"eslint-config-prettier": "^10.1.8",
90+
"eslint-plugin-jest": "^29.15.4",
91+
"eslint-plugin-react": "^7.37.5",
92+
"eslint-plugin-react-hooks": "^7.1.1",
93+
"father": "^4.6.24",
8894
"gh-pages": "^6.3.0",
8995
"glob": "^13.0.6",
96+
"globals": "^17.7.0",
9097
"husky": "^9.1.7",
9198
"identity-obj-proxy": "^3.0.0",
9299
"less": "^4.6.7",
93100
"lint-staged": "^17.0.8",
94-
"prettier": "^3.9.0",
95-
"@rc-component/select": "^1.8.0",
101+
"prettier": "^3.9.4",
96102
"rc-test": "^7.1.3",
97-
"react": "^18.3.1",
98-
"react-dom": "^18.3.1",
99-
"typescript": "^5.9.3"
103+
"react": "^19.2.7",
104+
"react-dom": "^19.2.7",
105+
"typescript": "^6.0.3",
106+
"typescript-eslint": "^8.62.1"
100107
},
101108
"peerDependencies": {
102109
"react": ">=16.9.0",

tests/__snapshots__/demo.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Example align 1`] = `
44
<div>

tests/__snapshots__/index.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[` 1`] = `
44
[

tests/__snapshots__/options.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Options should render correctly 1`] = `
44
<li

0 commit comments

Comments
 (0)