@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/controllersuses the following packages which lack TypeScript types. Currently we are just stubbing the modules independencies.d.ts, but this ends up addinganyto any objects that the modules export, andanytrickles 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 thecontrollerscodebase.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.tsare:eth-keyring-controller(decided to skip this)isomorphic-fetch(decided to skip this)single-call-balance-checker-abi(decided to skip this)web3-provider-engine(decided to skip this)