# no-process-env

Rule `node/no-process-env`. Disallow the use of `process.env`

- Source: node
- Technologies: Node.js
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1673 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `n/no-process-env` | no | no | package `eslint-plugin-n` | [docs](https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-env.md) |
| Oxlint | `node/no-process-env` | no | no | plugin `node`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/node/no-process-env.html) |
| Biome | `style/noProcessEnv` | no | no | group style, since 1.9.1 | [docs](https://biomejs.dev/linter/rules/no-process-env/) |

## Code examples

### Incorrect: the rule reports this

```js
if(process.env.NODE_ENV === "development") {
    //...
}
```

### Correct: the rule accepts this

```js
var config = require("./config");

if(config.env === "development") {
    //...
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import n from "eslint-plugin-n";

export default [
  {
    plugins: { n },
    rules: {
      "n/no-process-env": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "node"
  ],
  "rules": {
    "node/no-process-env": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noProcessEnv": "error"
      }
    }
  }
}
```

## Related rules

- [eslint/no-process-env](https://lintradar.dev/rules/eslint/no-process-env.md): Disallow the use of `process.env`
- [node/no-sync](https://lintradar.dev/rules/node/no-sync.md): Disallow synchronous methods
- [node/prefer-process-get-builtin-module](https://lintradar.dev/rules/node/prefer-process-get-builtin-module.md): Enforce using `process.getBuiltinModule()` to load Node.js built-in modules
- [node/no-unpublished-bin](https://lintradar.dev/rules/node/no-unpublished-bin.md): Disallow `bin` files that npm ignores
- [node/file-extension-in-import](https://lintradar.dev/rules/node/file-extension-in-import.md): Enforce the style of file extensions in `import` declarations
- [node/no-top-level-await](https://lintradar.dev/rules/node/no-top-level-await.md): Disallow top-level `await` in published modules

---

Web page: https://lintradar.dev/rules/node/no-process-env. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
