Skip to content

Adopt TypeScript 6#3997

Merged
nstepien merged 3 commits intomainfrom
ts6
Mar 11, 2026
Merged

Adopt TypeScript 6#3997
nstepien merged 3 commits intomainfrom
ts6

Conversation

@nstepien
Copy link
Collaborator

@nstepien nstepien commented Mar 9, 2026

@nstepien nstepien self-assigned this Mar 9, 2026
@nstepien nstepien marked this pull request as ready for review March 9, 2026 18:09
@nstepien nstepien requested a review from amanmahajan7 as a code owner March 9, 2026 18:09
}),
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

"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

"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!

@@ -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 🤔

},
"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.

@nstepien nstepien merged commit 1201a4f into main Mar 11, 2026
2 checks passed
@nstepien nstepien deleted the ts6 branch March 11, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants