Skip to content

Commit 2991a97

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Upgrade TypeScript to ^6.0.3 (#56772)
Summary: Pull Request resolved: #56772 Upgrades to TypeScript 6.0.3 and updates `typescript-eslint/*` for TS 6.0 compatibility across `react-native` and `metro`. #### Motivation TypeScript 6.0 (Mar 2026) will resolve #53565. Before updating in the React Native CLI template, align in RN and Metro source for consistency. This is an internal change since: - This upgrade only applies to TS analysis of these repos' source code. - Edits to `react-native/typescript-config/tsconfig.json` (which *is* distributed) maintain backwards compatibility. #### Changes **react-native** - Bump `typescript` from `^5.8.3` to `^6.0.3` - Bump `typescript-eslint/*` from `^8.24.0` to `^8.59.2` - Replace deprecated `moduleResolution: "node"` with `"node16"` and `target: "es5"` with `"es2015"` in codegen-typescript-test - Add explicit `types: ["jest", "node"]` where needed (TS 6.0 defaults `types` to `[]`) - Set `strict: false` in configs that only enable specific strict flags (TS 6.0 defaults `strict` to `true`) - Update `ModuleResolutionKind.NodeJs` to `Node16` in build config **metro** - Bump `typescript` from `5.8.3` to `^6.0.3` - Bump `typescript-eslint/*` from `^8.36.0` to `^8.59.2` - No tsconfig changes needed (`tsconfig/node20` preset is already TS 6.0 compatible) Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D104658690 fbshipit-source-id: 9a2feeb257d5783431941a911b17065fcd0389a5
1 parent e028946 commit 2991a97

8 files changed

Lines changed: 162 additions & 96 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@react-native/metro-config": "0.87.0-main",
6363
"@tsconfig/node22": "22.0.2",
6464
"@types/react": "^19.1.0",
65-
"@typescript-eslint/parser": "^8.36.0",
65+
"@typescript-eslint/parser": "^8.59.2",
6666
"ansi-regex": "^5.0.0",
6767
"ansi-styles": "^4.2.1",
6868
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
@@ -116,7 +116,7 @@
116116
"temp-dir": "^2.0.0",
117117
"tinybench": "^4.1.0",
118118
"tinyglobby": "^0.2.15",
119-
"typescript": "5.8.3",
119+
"typescript": "^6.0.3",
120120
"ws": "^7.5.10"
121121
},
122122
"resolutions": {

packages/eslint-config-react-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"@babel/core": "^7.25.2",
2828
"@babel/eslint-parser": "^7.25.1",
2929
"@react-native/eslint-plugin": "0.87.0-main",
30-
"@typescript-eslint/eslint-plugin": "^8.36.0",
31-
"@typescript-eslint/parser": "^8.36.0",
30+
"@typescript-eslint/eslint-plugin": "^8.59.2",
31+
"@typescript-eslint/parser": "^8.59.2",
3232
"eslint-config-prettier": "^8.5.0",
3333
"eslint-plugin-eslint-comments": "^3.2.0",
3434
"eslint-plugin-ft-flow": "^2.0.1",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"strictFunctionTypes": false
3+
"strict": false
44
},
55
"include": ["ReactNativeApi.d.ts"]
66
}

packages/react-native/types/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"module": "commonjs",
44
"lib": ["es6"],
5+
"strict": false,
56
"noImplicitAny": true,
67
"noImplicitThis": true,
78
"strictFunctionTypes": true,

private/react-native-codegen-typescript-test/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"lib": [
44
"es6"
55
],
6-
"module": "commonjs",
7-
"moduleResolution": "node",
8-
"target": "es5",
6+
"module": "node16",
7+
"moduleResolution": "node16",
8+
"target": "es2015",
9+
"types": ["jest", "node"],
910
"declaration": false,
1011
"sourceMap": false,
1112
"outDir": "./lib",

scripts/build/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function getTypeScriptCompilerOptions(
9898
case 'node':
9999
return {
100100
...require('@tsconfig/node22/tsconfig.json').compilerOptions,
101-
moduleResolution: ModuleResolutionKind.NodeJs,
101+
moduleResolution: ModuleResolutionKind.Node16,
102102
};
103103
}
104104
}

scripts/js-api/build-types/templates/tsconfig.test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"module": "esnext",
44
"lib": ["es2020"],
5+
"strict": false,
56
"noImplicitAny": true,
67
"noImplicitThis": true,
78
"types": [],

yarn.lock

Lines changed: 150 additions & 87 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)