Skip to main content

Stylistic choices

No classes

No reduce

info

Sheriff actually allows using reduce for basic operations like summing up numbers. Only complex operations are banned.

No enums

No overloads

  • Generics supersede them. Overloads are a legacy feature that was made available in TypeScript before generics were a thing. Overloads are mostly a C#/Angular leftover. Simply put: there are no problems that function overloads solve better than generics.
  • Overloads clutter the code and make it more verbose and harder to read, which increase the cognitive overload
  • Overloads clutter IDE tooltips.
  • Overloads force you to write non-standard JavaScript syntax.
  • Overloads enable flexibility, which also enables your team to write inconsistent code—exactly the problem ESLint is designed to solve.
  • Effective TypeScript explicitly warns against this, stating that conditional types are preferable.