Skip to content

Commit 8c21ffc

Browse files
committed
fix: align TypeScript and ESLint compatibility
1 parent 2247208 commit 8c21ffc

3 files changed

Lines changed: 16 additions & 23 deletions

File tree

eslint.config.mjs

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

2929
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-
};
30+
next.plugins = { ...next.plugins };
31+
delete next.plugins['@typescript-eslint'];
4032
}
4133

4234
if (next.rules) {
@@ -72,6 +64,18 @@ export default [
7264
'src/index.d.ts',
7365
],
7466
},
67+
{
68+
plugins: {
69+
'@typescript-eslint': {
70+
...tsEslintPlugin,
71+
rules: {
72+
...tsEslintPlugin.rules,
73+
'ban-types': noopRule,
74+
'consistent-type-exports': noopRule,
75+
},
76+
},
77+
},
78+
},
7579
...compat.config(require('./.eslintrc.js')).map(normalizeConfig),
7680
{
7781
rules: {

global.d.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,4 @@ declare const vi: {
5555
restoreAllMocks: () => void;
5656
};
5757

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

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4-
"baseUrl": "./",
54
"declaration": true,
65
"module": "esnext",
76
"target": "esnext",
8-
"moduleResolution": "node",
7+
"moduleResolution": "bundler",
98
"jsx": "react",
109
"skipLibCheck": true,
1110
"paths": {
12-
"@@/*": [".dumi/tmp/*"]
11+
"@@/*": ["./.dumi/tmp/*"]
1312
},
14-
"ignoreDeprecations": "6.0",
1513
"noImplicitAny": false,
1614
"strictNullChecks": false,
1715
"strictPropertyInitialization": false,

0 commit comments

Comments
 (0)