-
Notifications
You must be signed in to change notification settings - Fork 345
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
Tracker: Set defaults for all options using a config file #176
Comments
I have a patch started but it depends on yargs/yargs#464 |
FWIW, a yaml config might be nicer than JSON because you could put comments in it |
I would suggest making a .js file that exports a settings object instead. How about using a grunt task ie. Gruntfile.js like we can with |
Sure, a |
Looks like something like this should work:
web-ext.config.js
|
oh cool, that looks like it will work. I like using |
You could use something like rc to use JSON or INI config files.
I believe their specific config loader logic is in eslint/eslint /lib/config/config-file.js. |
It looks like rc will parse command line args and env vars but yargs already does that. It would be nice to just fix yargs/yargs#464 but I don't know how difficult that is. |
After chatting with @shubheksha yesterday, I think we have a good plan to do this without patching yargs:
|
@kumar303 @shubheksha I think that it can be useful to keep an eye to how eslint does its config file loading, e.g. some of the relevant pieces: |
Hi @shubheksha , I split this into three issues (linked above). The patch you've already started applies to #728 so don't worry about any other features that we need later on. This should help land each patch sooner! |
If a user has a magically named config file in the current working directory (e.g.
web-ext-config.json
) thenweb-ext
should use this to set default option values (and web-ext should log a message about using it). Here are a few other examples of how it should work:The config can also be specified explicitly:
The config file should apply to global option values as well as sub-command option values. Here is an example of a config that is the equivalent of
web-ext --verbose sign --api-url-prefix https://addons-dev.allizom.org/api/v3
:The camel case variants of each option should also be supported, such as:
Some additional rules:
~/.web-ext-config.json
as well as./web-ext-config.json
(these would override each other in the order listed here).The text was updated successfully, but these errors were encountered: