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
Add support for defining default value via environment variable #7617
Comments
What you are describing requires an user-provided config file, which already supports i.e. if both properties are supported only the config is necessary, if so |
@titouanmathis Thanks for opening the discussion. To be honest, I don't think the support of environment variables is necessary because a JS config file can cover the use case. For example:
However, as @Mouvedia commented, we haven't yet supported the If implementing the // stylelint.config.js
import myCustomFormatter from 'my-custom-formatter';
export default {
// A built-in formatter name
formatter: 'string', // | 'compact' | 'json' | ...
// Or a path to a custom formatter module
formatter: './path/to/my-custom-formatter.js',
// Or a custom formatter module
formatter: myCustomFormatter,
rules: { /* ... */ },
};
What do you think? |
👍
Create an issue or simply update #5142. |
#5142 seems outdated. Is there a problem with rewriting this issue's title? |
Or it seems better to open a new issue. I'll do that later. |
What is the problem you're trying to solve?
In a shareable GitLab CI configuration, I use the custom-formatter and cache CLI arguments to improve the performance of my code quality tests and upload reports t GitLab Code Quality Report feature.
This can then be used by include the configuration, and specifying the
STYLELINT_ARGS
variable:This implementation hide the complex configurations from the final user, but also limits them in terms of what they can do.
An ideal implementation would be to define the
--custom-formatter
,--cache
and--cache-location
as environment variables to make sure that they are correctly defined, while letting the final user use the command they need.What solution would you like to see?
Being able to define some CLI arguments as environment variables:
I think this could be implemented directly in
lib/cli.mjs
by setting default values when defining the flags.I am willing to work on this feature if this is approved.
The text was updated successfully, but these errors were encountered: