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

refactor(accounts-controller): use type-cast instead of @ts-expect-error #5568

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Mar 28, 2025

Explanation

Commenting out the @ts-expect-error was not very reliable sometimes (it works everytime on the CI, but not everytime when compiling/running tests locally). We sometimes have to uncomment the directive to run the tests (which is a bit annoying and force you to have some "unstaged change" in git).

The type-cast does get rid of the compile-error with WritableDraft while still providing the same "object signature" and has 0 impact at runtime either. So this is safe.

References

N/A

Changelog

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Base automatically changed from fix/accounts-controller-events-during-updates to main April 1, 2025 09:37
@ccharly ccharly force-pushed the refactor/accounts-controller-type-cast-excessively-deep-type-instanciation branch from f347aa0 to 9388740 Compare April 1, 2025 10:18
@ccharly ccharly changed the title refactor(accounts-controller): use type-cast instead of @ts-expect-error refactor(accounts-controller): use type-cast instead of @ts-expect-error Apr 1, 2025
@ccharly ccharly marked this pull request as ready for review April 1, 2025 10:54
@ccharly ccharly requested a review from a team as a code owner April 1, 2025 10:54
@ccharly ccharly enabled auto-merge (squash) April 8, 2025 12:39
@ccharly ccharly merged commit 223fa39 into main Apr 8, 2025
197 checks passed
@ccharly ccharly deleted the refactor/accounts-controller-type-cast-excessively-deep-type-instanciation branch April 8, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants