[no-signal-compare?] new rule request to prevent comparing signals via < or > #1753
Labels
package: eslint-plugin
Angular-specific TypeScript rules
triage
This issue needs to be looked at and categorized by a maintainer
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:
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?
The text was updated successfully, but these errors were encountered: