-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed 'extends' option to work. (#3916) #4057
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadOptions()
is a public function. You can't eliminate one important part of the option parsing which are command line - configuration files - package.json - mocha.opts - default values.
yargs-parser just parses literally options of cli.
Above statement is incorrect.
@juergba Thank you for review. I chose to add default builder as above for yargs() because I thought it is the most simplest way to solve this problem. So you mean I must not change the structure of parsing cli options and should keep the location of applying default, right? Then is it ok to add a extra logic for processing '--extends' options in loadOptions() instead? Thank you for your advice in advance. |
I already commented this issue here. It's certainly more complex than a
Yes. I don't see any other solution at the moment. Our configuration files are probably the ones which inherit by using |
Ok, I should've understood more about features of yargs and yargs-parser. |
@liloyek Do you intend to continue with this PR? |
@boneskull I still want to continue, but I think it's better to close this PR and make new one after I finish it. Is it ok? |
Hi, I fixed this issue by applying default values at yargs(), not yargs-parser.detailed().
Description of the Change
Before
Default values are applied by yargs-parser.detailed in options.js.
After
Etc
Applicable issues
fixed #3916