Skip to content

使用xxx === undefined,会无法通过某些代码规范扫描 #6063

@fanyipin

Description

@fanyipin

if (formattedValue === undefined) {

代码片段如上:
在很多前端规范里,不允许使用 xxx === undefined判断,上面代码片段中的写法会导致代码无法通过代码规范扫描,是否可以考虑改成 typeof xxx === 'undefined'。

说明:我们在小程序中使用时,会有部分项目组将miniprogram_npm提交到代码仓,而如上的写法将无法通过代码仓的规范扫描

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions