Skip to content
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

Bump typescript from ~5.2.2 to ~5.4.5 #4586

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Apply ts-expect-error to flaky immer type errors
  • Loading branch information
MajorLift committed Aug 2, 2024
commit f8b78d51abbdfaccef5c2068311150b61beec8b7
3 changes: 1 addition & 2 deletions packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ export class AccountsController extends BaseController<
metadata: { ...account.metadata, ...metadata },
};
// Do not remove this comment - This error is flaky: Comment out or restore the `ts-expect-error` directive below as needed.
// See: https://github.com/MetaMask/utils/issues/168
// // @ts-expect-error Known issue - `Json` causes recursive error in immer `Draft`/`WritableDraft` types
// // @ts-expect-error - Known issue: `Json` causes recursive error in immer `Draft`/`WritableDraft` types (See: https://github.com/MetaMask/utils/issues/168)
currentState.internalAccounts.accounts[accountId] = internalAccount;
});
}
Expand Down
2 changes: 2 additions & 0 deletions packages/permission-controller/src/PermissionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,8 @@ export class PermissionController<
);

if (caveatIndex === -1) {
// Do not remove this comment - This error is flaky: Comment out or restore the `ts-expect-error` directive below as needed.
// // @ts-expect-error - Known issue: `Json` causes recursive error in immer `Draft`/`WritableDraft` types (See: https://github.com/MetaMask/utils/issues/168)
permission.caveats.push(caveat);
} else {
permission.caveats.splice(caveatIndex, 1, caveat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ export class SubjectMetadataController extends BaseController<
*/
trimMetadataState(): void {
this.update((draftState) => {
// @ts-expect-error ts(2589)
// Do not remove this comment - This error is flaky: Comment out or restore the `ts-expect-error` directive below as needed.
// @ts-expect-error - Known issue: `Json` causes recursive error in immer `Draft`/`WritableDraft` types (See: https://github.com/MetaMask/utils/issues/168)
return SubjectMetadataController.getTrimmedState(
draftState,
this.subjectHasPermissions,
Expand Down
Loading