These are recent additions to @typescript-eslint. Will potentially require refactoring, but will make our codebase safer.
Some major cases where we currently use any:
catch clauses. We should use type guards to check the error type and asError() if we want the message.
- Custom type guards. This is currently difficult because the
in operator cannot narrow types from unknown. Composing type guards would work though, we should look into adopting a library like https://github.com/sindresorhus/is (and make sure it has functions and types expressive enough for us)
- HTTP responses. We should use explicit casts.
These are recent additions to
@typescript-eslint. Will potentially require refactoring, but will make our codebase safer.Some major cases where we currently use
any:catchclauses. We should use type guards to check the error type andasError()if we want the message.inoperator cannot narrow types fromunknown. Composing type guards would work though, we should look into adopting a library like https://github.com/sindresorhus/is (and make sure it has functions and types expressive enough for us)