Skip to content

BUG: defining an option which includes no- makes the option true by default #1301

Closed
@snitin315

Description

@snitin315

Current Behavior -
If we define an option whose name contains no- for e.g. module-no-parse, it makes the option true by default.

Expected Behavior -
It is supposed to do this only for flags with leading no- as mentioned in docs. https://github.com/tj/commander.js/#other-option-types-negatable-boolean-and-flagvalue

You can specify a boolean option long name with a leading no- to set the option value to false when used. Defined alone this also makes the option true by default.

Steps to reproduce -
Define an option whose name includes no- e.g. module-no-parse.
Check its default value in the parser.
Screenshot at 2020-07-16 20-28-38

Addition Info
Bug found via webpack/webpack-cli#1679

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCommander is not working as intended

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions