ethereum-abi-types-generator
ethereum-abi-types-generator copied to clipboard
Type-only imports
Hi, we've been using this library to generate our abi type defs and it's pretty great. There are just a couple issues we often come across (and have to fix by hand in every generated file right now).
We're enforcing type-only import syntax (i.e. setting "importsNotUsedAsValues": "error" in our tsconfig) but the generated files just use regular imports which means we get tonnes of errors for the generated files.
error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
1 import {
~~~~~~~~
2 ContractTransaction,
~~~~~~~~~~~~~~~~~~~~~~
...
6 BigNumberish,
~~~~~~~~~~~~~~~
7 } from 'ethers';
~~~~~~~~~~~~~~~~
Would it be easy enough to just change all imports to import type?
Hey thanks for rasing the issue so your saying you want the import to be like:
import type {
ContractTransaction,
BigNumberish,
} from 'ethers';
Yep 👍