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

Backfill TypeScript types for various dependencies #728

Closed
12 tasks done
mcmire opened this issue Mar 15, 2022 · 0 comments
Closed
12 tasks done

Backfill TypeScript types for various dependencies #728

mcmire opened this issue Mar 15, 2022 · 0 comments
Assignees

Comments

@mcmire
Copy link
Contributor

mcmire commented Mar 15, 2022

@metamask/controllers uses the following packages which lack TypeScript types. Currently we are just stubbing the modules in dependencies.d.ts, but this ends up adding any to any objects that the modules export, and any trickles down to code which uses these modules. While we can work around this, it is very inconvenient and it would be easier to write types directly for these modules so that we can have proper types throughout the controllers codebase.

Note that we can go further on this and replace the Ethereum utility packages with other packages that are already TypeScript-compatible (e.g. Ethers). However, that requires that we improve the unit tests first. Backfilling the types is intended as a band-aid.

The list of modules listed in dependencies.d.ts are:

  • @metamask/contract-metadata
  • @metamask/metamask-eth-abis (this already has types, so we can remove this!)
  • eth-ens-namehash
  • eth-json-rpc-infura
  • eth-keyring-controller (decided to skip this)
  • eth-phishing-detect
  • eth-query
  • ethjs-provider-http
  • ethjs-unit
  • isomorphic-fetch (decided to skip this)
  • single-call-balance-checker-abi (decided to skip this)
  • web3-provider-engine (decided to skip this)
@mcmire mcmire self-assigned this Mar 15, 2022
@Gudahtt Gudahtt closed this as completed Apr 21, 2022
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 a pull request may close this issue.

2 participants