You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just ran into a bug with a negated async pipe. Rule templates-no-negated-async didn't catch it because the parens were missing:
*ngIf="!loading$ | async"
This condition is perfectly valid, but this is not what was intended (a bit like the case of the box in the banana). Moreover, in cases where the parens are purposely left out, there are less confusing ways of implementing the same behaviour (like an extra ng-container with the !loading$ condition on its own).
Therefore, I feel like the templates-no-negated-async rule should be stricter and report async pipes that follow negated observables. To not break current behaviour, this could be implemented as an option.
The text was updated successfully, but these errors were encountered:
I just ran into a bug with a negated async pipe. Rule
templates-no-negated-async
didn't catch it because the parens were missing:This condition is perfectly valid, but this is not what was intended (a bit like the case of the box in the banana). Moreover, in cases where the parens are purposely left out, there are less confusing ways of implementing the same behaviour (like an extra
ng-container
with the!loading$
condition on its own).Therefore, I feel like the
templates-no-negated-async
rule should be stricter and report async pipes that follow negated observables. To not break current behaviour, this could be implemented as an option.The text was updated successfully, but these errors were encountered: