TypeChain icon indicating copy to clipboard operation
TypeChain copied to clipboard

Type is declared but never used.ts (6196)

Open sbahman opened this issue 2 years ago • 3 comments

I am using the abi from an open source contract and when I create types with typechain it has a line import type { PayableTransactionObject } This gives me the error 'PayableTransactionObject' is declared but never used.ts (6196). How can I avoid this without making my tsconfig less strict?

At the moment I am just deleting the line which makes everything work. However this means I need to track the file in git which goes against the recommendation of making typechain part of the build process.

sbahman avatar May 04 '22 14:05 sbahman

Can you share ABI and target name that generated such error? We are trying to avoid generation code that throws such warnings.

krzkaczor avatar May 15 '22 14:05 krzkaczor

This is the ABI File BridgeToken.txt

This is my tsconfig tsconfig.txt

The command I ran is: npx typechain --target=web3-v1 'contracts/*.json'

Note: I had to change the file endings of the files from .json to .txt to upload them to github as github prevented me from uploading files with .json file ending.

sbahman avatar May 24 '22 16:05 sbahman

Hi @krzkaczor have you had a chance to look in to this?

sbahman avatar Jun 13 '22 07:06 sbahman