eslint报错: Unexpected any value in conditional. An explicit comparison or type cast is required

原代码:
record.modifiedTime?
修改后代码:
typeof
record.modifiedTime !== 'undefined' ?
  (isAddType === true ? '新增' : '修改') + '审批规则'

 

出现场景:主要是if判断中和三双表达式中出现。

解决方式:直接比较值,不能使用


 

posted @ 2020-11-20 14:04  liaoing  阅读(1001)  评论(0编辑  收藏  举报