为什么我不能在这里使用带有 2 个语句的三元?
ESLint 错误:no-unused-expressions
res?.isSuccessful ?
(this.toastService.showToast(res.message, 'success'), this.queueDataService.addMember(attendee)) :
this.toastService.showToast(res.message, 'warning');
没有 ESLint 错误
res.isSuccessful ?
(this.toastService.showToast(res.message, 'success')) :
this.toastService.showToast(res.message, 'warning');
ESLInt
"@typescript-eslint/no-unused-expressions": [
"error",
{
"allowTernary": true,
}
]