-
Most of the time when I use Viem, I have issues with AddressType.
From my perspective the value add is low, the cost is high, and many people (me included) have to write more code to circumvent this check. Wouldn't it make more sense to use string as the default value for AddressType and let users that really need it configure it to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
At the moment, we still prefer it to be opt out instead of opt in. It's not that difficult to opt out — only 5 lines of code. declare module 'abitype' {
export interface Register {
AddressType: string
}
}
Importing JSON files is an anti-pattern for strict TypeScript. If you are using plain JS, you can still do better by using a
I wouldn't consider this a representative example.
Strict types don't prevent all issues that might arise, like invalid runtime values, but they add a small amount of friction to avoid common mistakes. It also makes types more obvious in your IDE, e.g. autocomplete, hints, lint messages. |
Beta Was this translation helpful? Give feedback.
At the moment, we still prefer it to be opt out instead of opt in. It's not that difficult to opt out — only 5 lines of code.
Importing JSON files is an anti-pattern for strict TypeScript. If you are using plain JS, you can still do better by using a
narrow(value)
function.I wouldn't consider this a representative example.
Str…