Skip to content

improve: type extension recognition for HardhatRuntimeEnvironment #934

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grasphoper
Copy link
Contributor

@grasphoper grasphoper commented Mar 21, 2025

Problem:

squigglies

deployments, ethers, getChainId don't get recognized by Typescript language server and give red squigglies, which makes hre hard to work with. This happens in multiple places in the contracts repo.

Solution:

Add tasks/ and deploy/ to include section in tsconfig.json. https://www.typescriptlang.org/tsconfig/#include

It makes the language server "include" these folders and resolve types properly for them. This shouldn't have any side effects. The only one I can guess is npm package, which should be fixable by .npmignore. But I checked the yarn pack output, and the tasks/ and deploy/ folders stayed similar to our current npm package.

Edit: after looking at CI output, I realize that I'd have to fix a lot of TS linter errors before this can go in. Do you guys think it's worth doing? 😄

@nicholaspai
Copy link
Member

Edit: after looking at CI output, I realize that I'd have to fix a lot of TS linter errors before this can go in. Do you guys think it's worth doing? 😄

I think its something you can do if you have spare capacity, but not urgent!

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