It would be great if the typescript rule S109 have the same customisation as the corresponding Java rule (java:S109).
The current rule have only 3 hardcoded values (-1,0,1) without the ability to change the values (like java:S109).
What do you have in mind? Do you have an example of numbers you wouldn’t want to be picked up by this rule? Or any particular reason to want to configure this?
We try hard to avoid configuration to keep things simple. Our view is that we rather try to find heuristics for the most common cases and accept the remaining ones as exceptions.
Do you think it would be fair to say that besides your examples and the ones in the ticket, the numbers would be mostly exceptions (rare occasions)?
My reasoning is that if the number has a specific meaning in the project, enough to motivate one to modify a rule, then it should be named in the code, and likely be defined in a single place. For exceptions, we have the “Won’t fix” action on issues.
Do you think that’s fair? Maybe I’m missing something.