From 042df8ca690c44d00f33f15dff9afca1c85ffdcb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 9 Mar 2026 17:57:52 +0000 Subject: [PATCH 1/2] Adopt TypeScript 6 --- .gitignore | 1 + eslint.config.js | 2 +- package.json | 3 ++- rolldown.config.ts | 2 +- src/EditCell.tsx | 15 --------------- src/css.d.ts | 1 + src/globals.d.ts | 2 +- test/globals.d.ts | 2 +- tsconfig.base.json | 11 ++--------- tsconfig.js.json | 1 + tsconfig.lib.json | 11 ----------- tsconfig.src.json | 2 +- tsconfig.test.json | 2 +- tsconfig.website.json | 4 ++-- 14 files changed, 15 insertions(+), 44 deletions(-) create mode 100644 src/css.d.ts delete mode 100644 tsconfig.lib.json diff --git a/.gitignore b/.gitignore index 47ab83bf80..b8bd53aef4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.cache +/.claude /coverage /dist /lib diff --git a/eslint.config.js b/eslint.config.js index eec49c1b09..911a1b068d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,7 +13,7 @@ import { defineConfig, globalIgnores } from 'eslint/config'; import tseslint from 'typescript-eslint'; export default defineConfig([ - globalIgnores(['.cache', '.nitro', '.output', '.tanstack', 'coverage', 'dist', 'lib']), + globalIgnores(['.cache', '.claude', '.nitro', '.output', '.tanstack', 'coverage', 'dist', 'lib']), { linterOptions: { diff --git a/package.json b/package.json index 69866f9628..9f923eb51f 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "react-dom": "^19.2.1", "rolldown": "1.0.0-rc.5", "rolldown-plugin-dts": "^0.22.1", - "typescript": "~5.9.2", + "typescript": "~6.0.1-rc", "typescript-eslint": "^8.56.0", "vite": "^8.0.0-beta.16", "vitest": "^4.0.17", @@ -86,6 +86,7 @@ "react-dom": "^19.2" }, "overrides": { + "typescript": "$typescript", "vite": "$vite" } } diff --git a/rolldown.config.ts b/rolldown.config.ts index e5ea32445b..23394ef5af 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -22,7 +22,7 @@ export default defineConfig({ classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-` }), dts({ - tsconfig: './tsconfig.lib.json' + tsconfig: './tsconfig.src.json' }) ] }); diff --git a/src/EditCell.tsx b/src/EditCell.tsx index 26825b2360..750aebf78f 100644 --- a/src/EditCell.tsx +++ b/src/EditCell.tsx @@ -11,21 +11,6 @@ import type { RenderEditCellProps } from './types'; -declare global { - const scheduler: Scheduler | undefined; -} - -interface Scheduler { - readonly postTask?: ( - callback: () => void, - options?: { - priority?: 'user-blocking' | 'user-visible' | 'background'; - signal?: AbortSignal; - delay?: number; - } - ) => Promise; -} - /* * To check for outside `mousedown` events, we listen to all `mousedown` events at their birth, * i.e. on the window during the capture phase, and at their death, i.e. on the window during the bubble phase. diff --git a/src/css.d.ts b/src/css.d.ts new file mode 100644 index 0000000000..a839446c75 --- /dev/null +++ b/src/css.d.ts @@ -0,0 +1 @@ +declare module '*.css' {} diff --git a/src/globals.d.ts b/src/globals.d.ts index 0651430d62..ee06893ccf 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -5,5 +5,5 @@ declare module 'react' { } } -// somehow required to make `declare global` work +// somehow required to make types work export {}; diff --git a/test/globals.d.ts b/test/globals.d.ts index 2f69ee4974..436818da18 100644 --- a/test/globals.d.ts +++ b/test/globals.d.ts @@ -9,5 +9,5 @@ declare module 'vitest/browser' { } } -// somehow required to make `declare global` work +// somehow required to make types work export {}; diff --git a/tsconfig.base.json b/tsconfig.base.json index a13da4ba7e..07a16bb57e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,26 +1,19 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, "composite": true, "emitDeclarationOnly": true, "erasableSyntaxOnly": true, "exactOptionalPropertyTypes": true, - "forceConsistentCasingInFileNames": true, "isolatedModules": true, "jsx": "react-jsx", - "lib": ["ESNext"], - "libReplacement": false, - "module": "esnext", + "lib": [], "moduleDetection": "force", "moduleResolution": "bundler", "noImplicitReturns": true, "noUnusedLocals": true, "outDir": "./.cache/ts", - "pretty": true, - "strict": true, + "strictNullChecks": true, // TODO: remove once `typescript-eslint` support TS 6 "target": "esnext", - "types": [], - "useUnknownInCatchVariables": true, "verbatimModuleSyntax": true } } diff --git a/tsconfig.js.json b/tsconfig.js.json index 689f0b6b48..612ab45753 100644 --- a/tsconfig.js.json +++ b/tsconfig.js.json @@ -3,6 +3,7 @@ "compilerOptions": { "allowJs": true, "checkJs": true, + "lib": ["ESNext"], "module": "NodeNext", "moduleResolution": "NodeNext" }, diff --git a/tsconfig.lib.json b/tsconfig.lib.json deleted file mode 100644 index e1cc3af350..0000000000 --- a/tsconfig.lib.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "composite": false, - "declaration": true, - "lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"], - "noCheck": true - }, - "files": ["src/index.ts"], - "include": ["src/globals.d.ts"] -} diff --git a/tsconfig.src.json b/tsconfig.src.json index b535e9f135..9a89c9d3e5 100644 --- a/tsconfig.src.json +++ b/tsconfig.src.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"] + "lib": ["ESNext", "DOM"] }, "include": ["src/**/*"] } diff --git a/tsconfig.test.json b/tsconfig.test.json index 12d9ca5250..0a8d0b1547 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"], + "lib": ["ESNext", "DOM"], "skipLibCheck": true, "types": ["vitest/globals"] }, diff --git a/tsconfig.website.json b/tsconfig.website.json index 8c78a220cf..becf2b7502 100644 --- a/tsconfig.website.json +++ b/tsconfig.website.json @@ -1,9 +1,9 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"], + "lib": ["ESNext", "DOM"], "skipLibCheck": true }, - "include": ["website/**/*"], + "include": ["src/css.d.ts", "website/**/*"], "references": [{ "path": "tsconfig.src.json" }] } From 671c4b0f13a4d310e86dc550ab53f101c72f7d46 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 9 Mar 2026 18:01:49 +0000 Subject: [PATCH 2/2] typo --- tsconfig.base.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index 07a16bb57e..413281e904 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -12,7 +12,7 @@ "noImplicitReturns": true, "noUnusedLocals": true, "outDir": "./.cache/ts", - "strictNullChecks": true, // TODO: remove once `typescript-eslint` support TS 6 + "strictNullChecks": true, // TODO: remove once `typescript-eslint` supports TS 6 "target": "esnext", "verbatimModuleSyntax": true }