Today, I discovered a handy trick in Angular where I can use the non-null operator to simplify validations in certain methods. For example:
public showAlertHeader(account: Account): boolean {
return account!.brownfieldState === this.PENDING || !(account!.address && account!.address!.id);
}
However, my tslint flagged an issue with this approach. Although I could configure it to not raise a complaint, it made me wonder whether using the non-null operator is actually a good or bad practice...