-
Notifications
You must be signed in to change notification settings - Fork 403
enable 'no-unsafe-call' lint #1905
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
Conversation
| declare const window: any; | ||
| declare const document: any; | ||
| const getElement = (id: string): HTMLInputElement => { | ||
| const e = document.getElementById(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this compile? How does TS know document.getElementById exists here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, in ledger-amino we have DOM types due to
"lib": ["es2020", "dom"]
webmaster128
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
webmaster128
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I will merge this manually to resolve the conflict from renaming cosmwasm-stargate
| return account ? accountFromAny(account) : null; | ||
| } catch (error: any) { | ||
| if (/rpc error: code = NotFound/i.test(error.toString())) { | ||
| if (/rpc error: code = NotFound/i.test(String(error))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can also use the solution from the other getAccount implementation:
} catch (error) {
assert(error instanceof Error);
if (/rpc error: code = NotFound/i.test(error.toString())) {
return null;
}
It avoids the any type and uses unknown instead. Any preference?
Part of #1750. Most warnings were in the ledger-amino web code.