no-process-env
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-process-env": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
if(process.env.NODE_ENV === "development") {
//...
}var config = require("./config");
if(config.env === "development") {
//...
}Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
no-process-env
eslint
export default [
{
rules: {
"no-process-env": "error",
},
},
];Oxlint does not have this rule.
style/noProcessEnv
style · since 1.9.1
{
"linter": {
"rules": {
"style": {
"noProcessEnv": "error"
}
}
}
}