Description
I would like to propose a new rule getting added to angular-eslint that will prevent two signals from being compared via <, <=, >, >= as it does not really make sense. After attending NgConf I noticed that it is very easy for even an expert angular developer to accidentally forgot to unbox two signals when trying to compare their unboxed values like so:
sig1 = signal(5)
sig2 = signal(2)
if (sig1 > sig2) // will never be true
if (sig1() > sig2()) // will be true in this case and is most likely always what we'd be going for in this scenario
it does seem valid to compare signals with === so it does seem like that should be allowed.
I did open this request to @angular/core and was suggested that I open the feature request here instead. Here is the closed issue from @angular/core
it seems it would be very helpful to get some warning/error feedback when attempts to do this are made and could possibly even have a quickFix option that just adds the calling of the signal instead of using the signal itself as experienced and new devs alike could spend plenty of time trying to figure out why their conditions are not being hit correctly when trying to use signals. The text could be similar to what we see when trying to compare numbers and strings?