Skip to content

chore: use typescript 6, remove esmoduleInteropFlag#16276

Open
vkarpov15 wants to merge 2 commits into
masterfrom
vkarpov15/typescript-6
Open

chore: use typescript 6, remove esmoduleInteropFlag#16276
vkarpov15 wants to merge 2 commits into
masterfrom
vkarpov15/typescript-6

Conversation

@vkarpov15
Copy link
Copy Markdown
Collaborator

Summary

Replaces #16255: turns out we also need to remove esModuleInterop option. Removing esModuleInterop shouldn't affect anything since esModuleInterop: false is the default anyway.

Examples

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repo’s TypeScript toolchain by bumping the TypeScript compiler version and simplifying the type-test tsconfig by removing an explicit esModuleInterop override.

Changes:

  • Bump typescript devDependency from 5.9.3 to 6.0.3.
  • Remove esModuleInterop: false from test/types/tsconfig.json (relying on defaults/inherited config).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.json Updates the TypeScript compiler version used by repo tooling (linting/type tests/bench workflows that use the root install).
test/types/tsconfig.json Removes an explicit esModuleInterop setting from the type-test TS config.

Comment thread package.json
Comment on lines 61 to 65
"pug": "3.0.4",
"sinon": "21.1.2",
"tstyche": "^7.0.0",
"typescript": "5.9.3",
"typescript": "6.0.3",
"typescript-eslint": "^8.31.1",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should run our tests on both TS 5 and 6 versions, the same way we run our js tests on a matrix of node and mongo versions. That way we guarantee our code works in both TS versions.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That would be a substantial change from our current policy of "only latest TypeScript is supported", which could be a big source of headache. Are you upgrading to TypeScript 6 or are you planning on staying on TypeScript 5 for the foreseeable future?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not currently using mongoose in any project I'm maintaining, I'd probably update TS to the latest version if I were.

only latest TypeScript is supported
Fair enough.

I see you changed this to 9.7 which makes things better.

Copy link
Copy Markdown
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

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

Other than Copilot's comment LGTM

@vkarpov15 vkarpov15 modified the milestones: 9.6.2, 9.6.3 May 8, 2026
Comment thread test/types/tsconfig.json
"compilerOptions": {
"esModuleInterop": false,
"strict": true,
"allowSyntheticDefaultImports": true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps it is worth removing allowSyntheticDefaultImports as well?

Same as esModuleInterop, TS6 deprecates setting allowSyntheticDefaultImports: false (reference).

Seems like it was added here together with esModuleInterop: false, because that would result in having allowSyntheticDefaultImports: false (reference). So it feels like both can be removed for TS6.

Suggested change
"allowSyntheticDefaultImports": true,

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label May 9, 2026
@hasezoey
Copy link
Copy Markdown
Collaborator

hasezoey commented May 9, 2026

I just saw the Milestone for this, consider moving this change to at least the next minor version.

@vkarpov15 vkarpov15 modified the milestones: 9.6.3, 9.7 May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typescript Types or Types-test related issue / Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants