Skip to content

feat: support TypeScript 5.8 #10903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 3, 2025
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"semver": "7.7.0",
"tmp": "^0.2.1",
"tsx": "*",
"typescript": ">=4.8.4 <5.8.0",
"typescript": ">=4.8.4 <5.9.0",
"typescript-eslint": "workspace:^",
"yargs": "17.7.2"
},
Expand All @@ -145,7 +145,7 @@
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"tmp": "0.2.1",
"tsx": "^4.7.2",
"typescript": "5.7.2"
"typescript": "5.8.2"
},
"packageManager": "yarn@3.8.2",
"nx": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"peerDependencies": {
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"funding": {
"type": "opencollective",
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"dependencies": {
"@typescript-eslint/scope-manager": "8.25.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/scope-manager/src/lib/dom.iterable.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions packages/scope-manager/src/lib/dom.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions packages/scope-manager/src/lib/esnext.float16.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/scope-manager/src/lib/esnext.promise.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/scope-manager/src/lib/esnext.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/scope-manager/src/lib/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/scope-manager/src/lib/webworker.iterable.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/scope-manager/src/lib/webworker.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/type-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export type Lib =
| 'esnext.collection'
| 'esnext.decorators'
| 'esnext.disposable'
| 'esnext.float16'
| 'esnext.full'
| 'esnext.intl'
| 'esnext.iterator'
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"typescript": "*"
},
"peerDependencies": {
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"funding": {
"type": "opencollective",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { version as TYPESCRIPT_ESTREE_VERSION } from '../version';
/**
* This needs to be kept in sync with package.json in the typescript-eslint monorepo
*/
export const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <5.8.0';
export const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <5.9.0';

/*
* The semver package will ignore prerelease ranges, and we don't want to explicitly document every one
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0"
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
"downlevel-dts": "*",
Expand Down
6 changes: 5 additions & 1 deletion tools/release/release.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { execaSync } from 'execa';
import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
import {
releaseChangelog,
releasePublish,
releaseVersion,
} from 'nx/release/index.js';
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated change, is there a reason to include it here?

This showed up in other places -at least #10887, cc @kirkwaiblinger- so maybe we need to do this in main?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, see #10903 (comment)

My theory is - but I haven't checked it yet - that TypeScript 5.8 behaves slightly different with deep imports in CommonJS modules that don't have specific secondary entry points.

On TS 5.7 this is not an issue, so I think it belongs to this PR. Although we could also add this to main first of course.

Copy link
Member

Choose a reason for hiding this comment

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

We had a poke around, and the change is due to microsoft/TypeScript#61057. TL;DR you can't omit the /index.js when importing from ESM in node. Seemingly executing with tsx rather than node has been preventing this from being a runtime error for us so far, but the TS 5.8 error is correct, and, accordingly, so is this change. 👍 Also @JamesHenry is aware and might tweak things on the nx side (whether just the docs or adding a subpath exports field)

Copy link
Member

Choose a reason for hiding this comment

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

As for plan of action - both #10887 and this PR genuinely need this change for different reasons (TS type-checking error here, and runtime error when using node 23.6, which #10887 resolves), so I'd say let's just keep the change in both PRs and whichever is merged first is merged first 🤷‍♂️

import yargs from 'yargs';

const options = await yargs(process.argv.slice(2))
Expand Down
Loading