-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: cli
Description
It is frustrating that babel-cli program does not validate options that are passed to it, e.g.
babel ./src --out-dir ./dist --copy-files --spurce-mapsThis will run the program without any error (note the spelling error in --spurce-maps; the intetended value is --source-maps).
Ideally, a CLI program should throw an error whenever an unknown property/ value is passed to it.
As far as I can tell, https://github.com/tj/commander.js does not support "strict" options parameter (like yargs#strict). Therefore, this could be achieved by:
- switching the implementation to yargs; or
- implementing JSON schema validation of the options object
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: cli