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โ€‹

Overloadsโ€ฆ

  • are superseded by generics. Overloads are a legacy, C#/Angular leftover that was made available in TypeScript before generics were a thing. There are no problems that overloads solve better than generics
  • clutter the code and make it more verbose and harder to read, which increase the cognitive overload
  • clutter IDE tooltips
  • force you to write non-standard JavaScript syntax
  • enable flexibility. In other words, they enable your team to write inconsistent codeโ€”exactly the problem that ESLint is designed to solve
  • are explicitly warned against in Effective TypeScript, which (quite correctly) claims that conditional types are preferable in every way