Open fvictorio opened 2 years ago
I'm not sold on this tbh. It starts polluting the core of hardhat with the functionality built on top. I know we've already done this a few times though
How can we do it in a way that doesn't cause that?
One idea: add the concept of warnings to the config validation, that way plugins can also emit warnings for certain patterns. But that's the first thing that comes to mind, there surely are other options.
In any case, I really think we need to do something about this issue. It happens a lot.
Well, your comment made me realize that maybe what we need is a better way for plugins to deal with the situation. We don't need it to be implemented before adding this warning.
This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
Another error that I've seen is:
solidity: {
compilers: [{ version: "0.8.4" }],
settings: { ... },
},
The settings
object is ignored.
IMO this should definitely be caught somehow.
If it's not producing an error, the misplaced settings
object could be merged with the settings in the compilers
array.
A very common mistake is doing this:
instead of
I think it's worth detecting these scenarios and showing a warning when there is a
settings
value in the root of the config but theuserConfig.solidity
value is a string. We could also throw an error, which would be annoying if some plugin usesconfig.settings
, but that could be worked around by changingsolidity: "0.8.4"
tosolidity: { version: "0.8.4" }