We are using Angular for our project and it uses constructor based dependency injection. This can lead to the constructor having a lot of parameters as it injects the necessary tokens for a given component / service.
The issue is that the “Functions should not have too many parameters” rule in JavaScript / TypeScript is great in every other context then this. We don’t want to raise the limit as normal functions & methods should not have too many parameters.
The feature request is some kind of regex based function/method exclusion to be included in the rule. This would allow us to exclude “constructor” from these checks, which will still affect normal class constructors but is far more ideal then having to raise the limit for this rule.
Here are the statistics I pulled for this issue within our organization (answering for Sean).
400+ logged code smells with this issue in the constructor
20+ separate repos impacted
minimum of 0 services and a maximum of 30+ services being injected into constructors in the Angular repos (most constructors typically have around 1 to 5 as a norm)
Outlier of around 30+ injected services in one of the constructors (this of course likely needs to be refactored)