Skip to content
This repository was archived by the owner on Oct 2, 2022. It is now read-only.
This repository was archived by the owner on Oct 2, 2022. It is now read-only.

对无 default 值的 option 处理提示 "used a non-exist options property" #15

Description

@creamidea

最近,碰到如下错误提示
image

初步分析代码,发现是这处代码处理导致。

yargs.option(name, utils.deleteUndefined(yargOption));

这里会对传递过来的 options 进行 undefined 值过滤,将其删除。导致后续代理访问 option 值时判定原型链上无该属性,出现错误提示。

判定是否存在该 option 声明的代码

而我这边使用的时候,的确是没有传入默认值。比如 alias

{
  alias: {
    type: 'string', // 这里实际会被解析成各种形式(字符串、对象、函数),不期望从命令行输入
    description: 'webpack alias',
  },
}

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