Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -86,6 +86,7 @@
"react-dom": "^19.2"
},
"overrides": {
"typescript": "$typescript",
"vite": "$vite"
}
}
2 changes: 1 addition & 1 deletion rolldown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default defineConfig({
classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-`
}),
dts({
tsconfig: './tsconfig.lib.json'
tsconfig: './tsconfig.src.json'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work just as well, so I removed the lib config

})
]
});
15 changes: 0 additions & 15 deletions src/EditCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>;
}

/*
* 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.
Expand Down
1 change: 1 addition & 0 deletions src/css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.css' {}
2 changes: 1 addition & 1 deletion src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ declare module 'react' {
}
}

// somehow required to make `declare global` work
// somehow required to make types work
export {};
2 changes: 1 addition & 1 deletion test/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ declare module 'vitest/browser' {
}
}

// somehow required to make `declare global` work
// somehow required to make types work
export {};
11 changes: 2 additions & 9 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's enabled by default

I tried disabling it and it logged

tsconfig.js.json:3:3 - error TS5107: Option 'allowSyntheticDefaultImports=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not log a deprecation warning if it's explicitly set to true 🤔

"composite": true,
"emitDeclarationOnly": true,
"erasableSyntaxOnly": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is.
From npx tsc --all:

  --forceConsistentCasingInFileNames  Ensure that casing is correct in imports.
                               type:  boolean
                            default:  true

"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["ESNext"],
"libReplacement": false,
"module": "esnext",
"lib": [],
"moduleDetection": "force",
"moduleResolution": "bundler",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"moduleResolution": "bundler",

This is the default, no?

Copy link
Collaborator Author

@nstepien nstepien Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--moduleResolution Specify how TypeScript looks up a file from a given module specifier.
           one of: node16, nodenext, bundler
          default: `nodenext` if `module` is `nodenext`; `node16` if `module` is `node16` or `node18`; otherwise, `bundler`.

It should be, but with conditions. Maybe best to enforce it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "./.cache/ts",
"pretty": true,
"strict": true,
"strictNullChecks": true, // TODO: remove once `typescript-eslint` supports TS 6
"target": "esnext",
"types": [],
"useUnknownInCatchVariables": true,
"verbatimModuleSyntax": true
}
}
1 change: 1 addition & 0 deletions tsconfig.js.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"lib": ["ESNext"],
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
Expand Down
11 changes: 0 additions & 11 deletions tsconfig.lib.json

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"]
"lib": ["ESNext", "DOM"]
},
"include": ["src/**/*"]
}
2 changes: 1 addition & 1 deletion tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable", "DOM.AsyncIterable"],
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"types": ["vitest/globals"]
},
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.website.json
Original file line number Diff line number Diff line change
@@ -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" }]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does references not pull css.d.ts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.
When using composite projects, references are loaded from compiled type definitions, not source files, and css.d.ts/globals.d.ts are not preserved.
Which is probably better, so global types/overrides are not automatically reused, especially so we don't pollute other projects when they import react-data-grid.

You can check the output in .cache/ts/src if you want to double-check.

}
Loading