Skip to content

Commit 0324e53

Browse files
committed
fix: align TypeScript and ESLint compatibility
1 parent f57dc1e commit 0324e53

3 files changed

Lines changed: 25 additions & 31 deletions

File tree

eslint.config.mjs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@ function normalizeConfig(config) {
2525
const next = { ...config };
2626

2727
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-
};
28+
next.plugins = { ...next.plugins };
29+
delete next.plugins['@typescript-eslint'];
3830
}
3931

4032
if (next.rules) {
@@ -67,6 +59,18 @@ export default [
6759
'src/index.d.ts',
6860
],
6961
},
62+
{
63+
plugins: {
64+
'@typescript-eslint': {
65+
...tsEslintPlugin,
66+
rules: {
67+
...tsEslintPlugin.rules,
68+
'ban-types': noopRule,
69+
'consistent-type-exports': noopRule,
70+
},
71+
},
72+
},
73+
},
7074
...compat.config(require('./.eslintrc.js')).map(normalizeConfig),
7175
{
7276
rules: {

global.d.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,4 @@ declare const vi: {
4646
restoreAllMocks: () => void;
4747
};
4848

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-
5849
declare module 'moment/locale/zh-cn';

tsconfig.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
{
22
"compilerOptions": {
33
"target": "esnext",
4-
"moduleResolution": "node",
5-
"baseUrl": "./",
4+
"moduleResolution": "bundler",
65
"jsx": "react",
76
"declaration": true,
87
"skipLibCheck": true,
98
"esModuleInterop": true,
109
"paths": {
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/*"]
10+
"@/*": ["./src/*"],
11+
"@@/*": ["./.dumi/tmp/*"],
12+
"@rc-component/table": ["./src/index.ts"],
13+
"@rc-component/table/es": ["./src"],
14+
"@rc-component/table/es/*": ["./src/*"],
15+
"rc-table": ["./src/index.ts"],
16+
"rc-table/es": ["./src"],
17+
"rc-table/es/*": ["./src/*"]
1918
},
20-
"ignoreDeprecations": "6.0",
2119
"noImplicitAny": false,
2220
"strictNullChecks": false,
2321
"strictPropertyInitialization": false,
2422
"strictFunctionTypes": false,
2523
"strict": false,
2624
"noImplicitThis": false,
27-
"strictBindCallApply": false
25+
"strictBindCallApply": false,
26+
"module": "ESNext"
2827
},
2928
"include": [
3029
"react-compat.d.ts",

0 commit comments

Comments
 (0)