Skip to content

Adopt ESLint rules to prevent unsafe use of any #75

@felixfbecker

Description

@felixfbecker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions