Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow npm_config_*-style params for no-process-env #11808

@brettz9

Description

@brettz9

What rule do you want to change?

no-process-env

Does this change cause the rule to produce more or fewer warnings?

Fewer warnings.

How will the change be implemented? (New option, new default behavior, etc.)?

Either as a new option specifically for this form of variable, a configurable option allowing a user-customized pattern to indicate variables exempt from the rule, or a new default behavior specifically for this form of variable.

Please provide some example code that this change will affect:

console.log(process.env.npm_config_test);

What does the rule currently do for this code?

Reports "Unexpected use of process.env"

What will the rule do after it's changed?

Report nothing.

Are you willing to submit a pull request to implement this change?

Not at this time.

Rationale

As per https://docs.npmjs.com/misc/config#environment-variables , npm has this npm_config_* means of passing in config through npm scripts. Although it is possible that environments could set these variables, it is more likely that npm scripts are, as designed, passing in this config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueenhancementThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions