Open jrencz opened 8 years ago
Nice idea. Your can already achieve a function param limit with the built-in ESLint rule max-params (http://eslint.org/docs/rules/max-params), but a custom rule for angular would be nice too.
Not all functions are handled with angular DI so it would be inprecise to use just max-params. On the other hand it may be fair enough: I can't think of functions that are allowed to have more params than those handled by Angular DI
In fact DI is the reason I don't use max-params: I'd have to allow way more params then I intend to allow for all non-DI functions.
It would be best to allow setting a distinct limit for DI-handled functions and another one for all other functions - I assume one would like to allow more params in DI-handled functions than those that are not handled by DI. The rule I suggested could replace max-params in Angular apps
Ok, no I understand your use-case. Actually I had the same problem and the max-params were way to high for normal function.
@tilmanpotthof have you had any chance of working on this feature suggestion?
There should be a way to enforce maximum number of dependencies: both module dependencies and injected services. It may be used to enforce architectural decisions when a module grows.