# no-process-exit

Rule `unicorn/no-process-exit`. Disallow `process.exit()`.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +28.3% last quarter
- Rank: #900 by reach, #1155 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-process-exit` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-process-exit.md) |
| Oxlint | `unicorn/no-process-exit` | no | no | plugin `unicorn`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-process-exit.html) |
| Biome | `nursery/noProcessExit` | no | no | group nursery, since 2.6.0 | [docs](https://biomejs.dev/linter/rules/no-process-exit/) |

## Code examples

### Incorrect: the rule reports this

```js
process.exit(0);
```

### Correct: the rule accepts this

```js
process.exit(0);
```

```js
process.on('SIGINT', () => {
  console.log('Got SIGINT');
  process.exit(1);
});
```

```js
import workerThreads from 'node:worker_threads';

try {
  // Do something…
  process.exit(0);
} catch (_) {
  process.exit(1);
}
```

Examples from the ESLint documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicorn/no-process-exit": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noProcessExit": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [node/no-process-exit](https://lintradar.dev/rules/node/no-process-exit.md): Disallow the use of `process.exit()`
- [eslint/no-process-exit](https://lintradar.dev/rules/eslint/no-process-exit.md): Disallow the use of `process.exit()`
- [unicorn/prefer-global-this](https://lintradar.dev/rules/unicorn/prefer-global-this.md): Prefer `globalThis` over `window`, `self`, and `global`.
- [unicorn/no-useless-iterator-to-array](https://lintradar.dev/rules/unicorn/no-useless-iterator-to-array.md): Disallow unnecessary `.toArray()` on iterators.
- [unicorn/prefer-string-raw](https://lintradar.dev/rules/unicorn/prefer-string-raw.md): Prefer using the `String.raw` tag to avoid escaping `\`.
- [unicorn/prefer-top-level-await](https://lintradar.dev/rules/unicorn/prefer-top-level-await.md): Prefer top-level await over top-level promises and async function calls.

---

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