You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Enable Feature Flags with Environment Variables
86
+
87
+
You can also set feature flags using the `ESLINT_FLAGS` environment variable. Multiple flags can be specified as a comma-separated list and are merged with any flags passed on the CLI or in the API. For example, here's how you can add feature flags to your `.bashrc` or `.bash_profile` files:
88
+
89
+
```bash
90
+
export ESLINT_FLAGS="flag_one,flag_two"
91
+
```
92
+
93
+
This approach is especially useful in CI/CD pipelines or when you want to enable the same flags across multiple ESLint commands.
94
+
85
95
### Enable Feature Flags with the API
86
96
87
97
When using the API, you can pass a `flags` array to both the `ESLint` and `Linter` classes:
@@ -98,6 +108,10 @@ const linter = new Linter({
98
108
});
99
109
```
100
110
111
+
::: tip
112
+
The `ESLint` class also reads the `ESLINT_FLAGS` environment variable to set flags.
113
+
:::
114
+
101
115
### Enable Feature Flags in VS Code
102
116
103
117
To enable flags in the VS Code ESLint Extension for the editor, specify the flags you'd like in the `eslint.options` setting in your `settings.json` file:
it("should emit a warning and not error out when an inactive flag that has been replaced by another flag is used in an environment variable",async()=>{
0 commit comments