Stylistic choices
No classes
- red-javascript-style-guide - why disallow class
- Sheriff tries to promote a “light functional” approach. JavaScript classes don’t fit such design.
No reduce
info
Sheriff actually allows using reduce
for basic operations like summing up numbers.
Only complex operations are banned.
No enums
- eslint-plugin-typescript-enum - README
- Enums considered harmful
- How to use TypeScript Enums and why not to, maybe
- Let's Talk About TypeScript's Worst Feature
- Effective TypeScript explicitly warn against this, saying that
enums
belong to a legacy design choice of TypeScript.
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.