Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

security.reliability

Avoid `process.exit` in application code

Do not call `process.exit` from application logic; reserve termination for CLI entrypoints.

#Metadata

Rule ID
ts.runtime.no-process-exit
Severity
medium
Confidence
0.9
Languages
javascript, typescript
Presets
recommended, security, strict
Stability
stable
Applies to
block
Tags
node, rules-catalog, runtime

#Why it matters

Forced process termination bypasses graceful shutdown, in-flight request draining, and cleanup hooks.

#Remediation

Propagate errors to the caller or use graceful shutdown hooks instead of calling `process.exit`.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.runtime.no-process-exit.rule.yaml.