TSFluff
TSFluff copied to clipboard
Rule idea: overload-coverage
Promiscuous types and type unions in signatures are legacy JavaScript code-smell. TypeScript comes with an Expressive Type System that allows for expressions in type signatures. Any Haskell developer who has previously scoffed at the procedural nature of ES will feel right at home.
New rule
I propose introducing a rule that enforces good form by demanding a minimum overload coverage.
-
overload-coverage
.
Example:
"overload-coverage": [
true,
{
"require-returntype": true,
"minimum-coverage": 0.8
}
]
Options
-
minimum-coverage
: Require at least this ratio of type signatures to be over,loads of another signature. -
require-returntype
: Require the return type to be different for a signature to count as different
This is horrific, I love it