-
Notifications
You must be signed in to change notification settings - Fork 271
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
CODEBASE: Fix lint errors 1 #1732
CODEBASE: Fix lint errors 1 #1732
Conversation
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.
I'm glad you're doing these in chunks. There's a large part of this that I'm fine with, but then an equally large part that I'm not so sure about.
After discussing on Discord, I made these changes:
Edit: I also implemented the usage of |
Regarding this one I was also confused by why it gets triggered on the caught exceptions so I dug a bit deeper. The string interpolation for Most of our use cases are string | number | Error where we check for unknown types and the object types have already been checked for, which are all legit for the linter. We could safely create a helper to type guard against most of these use cases, especially in regards to console.error, log, rethrow or showing errors on the UI. The only issue is that narrowing primitives or generic objects from 'unknown' still lacks the toString guarantee, it would have to be explicitly checked for known string-compatible types or stringify them with JSON.stringify. The reason I am mentioning this is that everywhere that ${String(e)} solves the problem of 'no-base-to-string' for ${e} the linter should also complain, and it isn't. I'm not sure where that got disabled, though it may be accidental. Source: https://typescript-eslint.io/rules/no-base-to-string/ |
For the context of that decision:
|
This is a part of the series of PRs for #1730. It mostly deals with simple lint errors.