Skip to content

Commit 1201a4f

Browse files
authored
Adopt TypeScript 6 (#3997)
* Adopt TypeScript 6 * typo
1 parent 88cc277 commit 1201a4f

File tree

12 files changed

+13
-43
lines changed

12 files changed

+13
-43
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"react-dom": "^19.2.1",
7676
"rolldown": "1.0.0-rc.5",
7777
"rolldown-plugin-dts": "^0.22.1",
78-
"typescript": "~5.9.2",
78+
"typescript": "~6.0.1-rc",
7979
"typescript-eslint": "^8.56.0",
8080
"vite": "^8.0.0-beta.16",
8181
"vitest": "^4.0.17",
@@ -86,6 +86,7 @@
8686
"react-dom": "^19.2"
8787
},
8888
"overrides": {
89+
"typescript": "$typescript",
8990
"vite": "$vite"
9091
}
9192
}

rolldown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-`
2323
}),
2424
dts({
25-
tsconfig: './tsconfig.lib.json'
25+
tsconfig: './tsconfig.src.json'
2626
})
2727
]
2828
});

src/EditCell.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@ import type {
1111
RenderEditCellProps
1212
} from './types';
1313

14-
declare global {
15-
const scheduler: Scheduler | undefined;
16-
}
17-
18-
interface Scheduler {
19-
readonly postTask?: (
20-
callback: () => void,
21-
options?: {
22-
priority?: 'user-blocking' | 'user-visible' | 'background';
23-
signal?: AbortSignal;
24-
delay?: number;
25-
}
26-
) => Promise<unknown>;
27-
}
28-
2914
/*
3015
* To check for outside `mousedown` events, we listen to all `mousedown` events at their birth,
3116
* i.e. on the window during the capture phase, and at their death, i.e. on the window during the bubble phase.

src/css.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module '*.css' {}

src/globals.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ declare module 'react' {
55
}
66
}
77

8-
// somehow required to make `declare global` work
8+
// somehow required to make types work
99
export {};

test/globals.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ declare module 'vitest/browser' {
99
}
1010
}
1111

12-
// somehow required to make `declare global` work
12+
// somehow required to make types work
1313
export {};

tsconfig.base.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
{
22
"compilerOptions": {
3-
"allowSyntheticDefaultImports": true,
43
"composite": true,
54
"emitDeclarationOnly": true,
65
"erasableSyntaxOnly": true,
76
"exactOptionalPropertyTypes": true,
8-
"forceConsistentCasingInFileNames": true,
97
"isolatedModules": true,
108
"jsx": "react-jsx",
11-
"lib": ["ESNext"],
12-
"libReplacement": false,
13-
"module": "esnext",
9+
"lib": [],
1410
"moduleDetection": "force",
1511
"moduleResolution": "bundler",
1612
"noImplicitReturns": true,
1713
"noUnusedLocals": true,
1814
"outDir": "./.cache/ts",
19-
"pretty": true,
20-
"strict": true,
15+
"strictNullChecks": true, // TODO: remove once `typescript-eslint` supports TS 6
2116
"target": "esnext",
22-
"types": [],
23-
"useUnknownInCatchVariables": true,
2417
"verbatimModuleSyntax": true
2518
}
2619
}

tsconfig.js.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"allowJs": true,
55
"checkJs": true,
6+
"lib": ["ESNext"],
67
"module": "NodeNext",
78
"moduleResolution": "NodeNext"
89
},

tsconfig.lib.json

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

tsconfig.src.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
4-
"lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"]
4+
"lib": ["ESNext", "DOM"]
55
},
66
"include": ["src/**/*"]
77
}

0 commit comments

Comments
 (0)