no-process-env
UnreleasedConfiguration
rslint.config.ts
Rule details
Disallows process.env and process["env"] accesses. Keeping environment-dependent settings in a configuration module makes them easier to manage throughout a project.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
allowedVariables is an array of environment variable names that may be accessed. It defaults to an empty array.
With this configuration, process.env.NODE_ENV and process["env"]["NODE_ENV"] are allowed. Reading process.env itself or accessing other variable names still reports an error. Computed variable names such as process.env[name] are not exempted.
This rule has no automatic fix or suggestions.