--no-config does not stop config file from being loaded
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I've got the following:
const argv = yargs.options({
config: {
string: true,
config: true,
default: 'mypackagerc'
},
myValue: { string: true }
});
This is working well, except that if I do --no-config, the config is still loaded if a file matching the default value exists.
It seems that config might be handled before the --no, as config is set to a value of false but properties from the mypackagerc are still loaded in.
configParser is also not passed the false value, so I can't detect it that way.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the yargs option-parsing path and the configParser entry point described in the report. Reproduce the snippet with --no-config and a present mypackagerc file; done means the file is not loaded and its properties are not added when the option is false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100