CallingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
process.exit() in a library or non-CLI module terminates the entire Node.js process, which is almost never the right thing to do. Callers have no opportunity to clean up or handle the exit gracefully. Throwing an error instead gives the caller full control.
| Recommended | ✅ recommended · ☑️ unopinionated |
| Fixable | — |
| Suggestions | — |
Examples
Allowed contexts
The rule allowsprocess.exit() in three situations:
- CLI files — the first line of the file is a hashbang (
#!/usr/bin/env node). - Process event handlers — inside a
process.on(…)orprocess.once(…)callback. - Worker thread files — the file imports
worker_threadsornode:worker_threads.
This is an extension of ESLint’s built-in
no-process-exit rule with the three exceptions above added on top.