From 2b2872047820351f11f73280e98fc677427be7e2 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 7 Nov 2022 18:17:12 -0330 Subject: [PATCH] Update TypeScript to the latest stable version TypeScript has been updated to the latest stable version. Additional TypeScript options added in these versions have been migrated into the `tsconfig.json` from the MetaMask module template. One option was kept back for now: `noUncheckedIndexedAccess`. This option resulted in too many errors, so will be attempted in a separate PR. The range was updated to use `~` because TypeScript doesn't follow SemVer; their minor releases can include breaking changes. --- package.json | 2 +- tsconfig.json | 2 ++ yarn.lock | 18 +++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index bb9b1d9..1e0627c 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "stdio-mock": "^1.2.0", "ts-jest": "^28.0.0", "ts-node": "^10.7.0", - "typescript": "^4.2.4" + "typescript": "~4.8.4" }, "packageManager": "yarn@3.2.1", "engines": { diff --git a/tsconfig.json b/tsconfig.json index 02eb0aa..325cfd2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,13 @@ { "compilerOptions": { "esModuleInterop": true, + "exactOptionalPropertyTypes": true, "forceConsistentCasingInFileNames": true, "lib": ["ES2020"], "module": "CommonJS", "moduleResolution": "node", "noEmit": true, + "noErrorTruncation": true, "strict": true, "target": "es2017" }, diff --git a/yarn.lock b/yarn.lock index 4b6c8cb..0cf09bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -904,7 +904,7 @@ __metadata: stdio-mock: ^1.2.0 ts-jest: ^28.0.0 ts-node: ^10.7.0 - typescript: ^4.2.4 + typescript: ~4.8.4 which: ^2.0.2 yaml: ^2.1.1 yargs: ^17.5.1 @@ -5970,23 +5970,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.2.4": - version: 4.7.4 - resolution: "typescript@npm:4.7.4" +"typescript@npm:~4.8.4": + version: 4.8.4 + resolution: "typescript@npm:4.8.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 5750181b1cd7e6482c4195825547e70f944114fb47e58e4aa7553e62f11b3f3173766aef9c281783edfd881f7b8299cf35e3ca8caebe73d8464528c907a164df + checksum: 3e4f061658e0c8f36c820802fa809e0fd812b85687a9a2f5430bc3d0368e37d1c9605c3ce9b39df9a05af2ece67b1d844f9f6ea8ff42819f13bcb80f85629af0 languageName: node linkType: hard -"typescript@patch:typescript@^4.2.4#~builtin": - version: 4.7.4 - resolution: "typescript@patch:typescript@npm%3A4.7.4#~builtin::version=4.7.4&hash=7ad353" +"typescript@patch:typescript@~4.8.4#~builtin": + version: 4.8.4 + resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin::version=4.8.4&hash=7ad353" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9096d8f6c16cb80ef3bf96fcbbd055bf1c4a43bd14f3b7be45a9fbe7ada46ec977f604d5feed3263b4f2aa7d4c7477ce5f9cd87de0d6feedec69a983f3a4f93e + checksum: 563a0ef47abae6df27a9a3ab38f75fc681f633ccf1a3502b1108e252e187787893de689220f4544aaf95a371a4eb3141e4a337deb9895de5ac3c1ca76430e5f0 languageName: node linkType: hard