Skip to content

Change Request: allow passing feature flags via environment variable #19100

@bradzacher

Description

@bradzacher

ESLint version

v9.x

What problem do you want to solve?

Currently the only way to pass feature flags is via the CLI or NodeJS API directly.

This is cumbersome at scale because:

  • opting-in users into the flags can require large-scale coordination to get people to change their IDE config
  • turning on a flag means having to update all NodeJS API usages across a repository at the same time

What do you think is the correct solution?

A much simpler alternative would be allowing passing of feature flags via an environment variable.
This would allow setting of the flags via direnv or similar tools to transparently turn on the flags for all developers and tools working in the repo.

For example at Canva we have tools that would allow us to inject an export ESLINT_FLAGS="unstable_config_lookup_from_file" or similar into all users .bashrc/etc file -- but for various reasons we could not easily get all users to change their IDE configs (there are multiple IDEs and no shared configuration, for example).

Participation

  • I am willing to submit a pull request for this change.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusioncoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions