Skip to content

boolean type is not inferred from default #419

@hongaar

Description

@hongaar

When specifying an option:

command.option("flag", {
  default: false
})

Typing works, but yargs type is not inferred.

e.g. when running with node app.js --flag x, the args.flag has a value of "x" instead of throwing an error (as it would with "type": "boolean")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions