Skip to content

Commit b2fc2d0

Browse files
authored
Update TypeScript to 5.7.2 (#1082)
## Summary: Wonder Blocks is updating Storybook to 8.x which requires using "moduleResolution": "bundler" in its tsconfig, see https://stackoverflow.com/questions/72193784/why-doesnt-the-exports-field-of-npm-work-in-typescript for details. To fix this, I decided to update TypeScript in Wonder Blocks. Instead of updating to the minimally required version I figured I may as well upgrade to the most recent version since I'm upgrading anyways. Although we probably don't need to update TypeScript in all of our repos at the same time (unless we start using new syntax), we may as well. In theory, this shouldn't affect the output of the code since we use babel for compilation. Issue: None ## Test plan: - yarn typecheck Author: kevinb-khan Reviewers: somewhatabstract, kevinb-khan Required Reviewers: Approved By: somewhatabstract Checks: ✅ Test (macos-latest, 20.x), ✅ codecov/project, ✅ CodeQL, ✅ Lint, typecheck, and coverage check (ubuntu-latest, 20.x), ✅ gerald, ✅ Analyze (javascript), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ dependabot Pull Request URL: #1082
1 parent 4673bc2 commit b2fc2d0

File tree

7 files changed

+114
-122
lines changed

7 files changed

+114
-122
lines changed

.changeset/tidy-walls-destroy.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn.lock linguist-generated

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"@types/jsdom": "^21.1.1",
3838
"@types/superagent": "^4.1.16",
3939
"@types/winston": "^2.4.4",
40-
"@typescript-eslint/eslint-plugin": "^6.9.1",
41-
"@typescript-eslint/parser": "^6.21.0",
40+
"@typescript-eslint/eslint-plugin": "^7.3.1",
41+
"@typescript-eslint/parser": "^7.3.1",
4242
"babel-jest": "^29.7.0",
4343
"babel-watch": "^7.8.1",
4444
"eslint": "^8.52.0",
@@ -71,7 +71,7 @@
7171
"rollup-plugin-preserve-shebangs": "^0.2.0",
7272
"superagent": "^5.3.1",
7373
"typedoc": "^0.25.3",
74-
"typescript": "^5.1.5",
74+
"typescript": "5.7.2",
7575
"winston": "^3.10.0"
7676
},
7777
"resolutions": {

packages/wonder-stuff-i18n/src/utils/extract-i18n.ts

-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ export function* extractStrings(
486486
const endOffset =
487487
textString.indexOf(
488488
groups.ngettext_plural,
489-
// @ts-expect-error [FEI-5011] - TS2532 - Object is possibly 'undefined'.
490489
match.index + groups.ngettext_singular.length,
491490
) + groups.ngettext_plural.length;
492491
yield {

packages/wonder-stuff-render-environment-jsdom/src/apply-abortable-promises-patch.ts

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export const applyAbortablePromisesPatch = (force = false): void => {
3636
const ourAbort = () => {
3737
/* empty */
3838
};
39-
// @ts-expect-error We know that the inferred type is wrong here and
40-
// it's not worth convincing TS with a better type, so just suppress it.
4139
ourAbort[patchedMarker] = true;
4240

4341
// @ts-expect-error We know this isn't on the Promise type. We could

tsconfig-common.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@
2626

2727
/* Completeness */
2828
"skipDefaultLibCheck": true, // it's safe to assume that built-in .d.ts files are correct
29-
"skipLibCheck": false
29+
// Setting `skipLibCheck: true`, avoids the following issues in various .d.ts files:
30+
// - node_modules/@google-cloud/kms/node_modules/long/index.d.ts:446:1 - error
31+
// TS1203: Export assignment cannot be used when targeting ECMAScript modules.
32+
// Consider using 'export default' or another module format instead.
33+
// - node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts:19:3551 - error
34+
// TS2694: Namespace 'ts' has no exported member 'InputFiles'.
35+
// Conflicts with node_modules/typescript/lib/typescript.d.ts.
36+
// - node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts:19:3567 - error
37+
// TS2694: Namespace 'ts' has no exported member 'UnparsedSource'.
38+
// Conflicts with node_modules/typescript/lib/typescript.d.ts.
39+
// - node_modules/typescript/lib/typescript.d.ts:5515:15 - error
40+
// TS2320: Interface 'AssertEntry' cannot simultaneously extend types 'ImportAttribute' and 'Node'.
41+
// Conflicts with node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts
42+
// - node_modules/typescript/lib/typescript.d.ts:5518:15 - error
43+
// TS2320: Interface 'AssertClause' cannot simultaneously extend types 'ImportAttributes' and 'Node'.
44+
// Conflicts with node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts
45+
// NOTE(kevinb): I tried update @typescript-eslint/plugin and @typescript-eslint/parser to
46+
// the most recent version (8.17.0 at the time this was written) but it didn't have any
47+
// effect on these errors.
48+
"skipLibCheck": true,
3049
}
3150
}

yarn.lock

+88-115
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)