This rule is an extension to ESLint's no-process-exit
rule, that allows process.exit()
to be called in files that start with a hashbang → #!/usr/bin/env node
. It also allows process.exit()
to be called in process.on('<event>', func)
event handlers.
process.exit(0);
#!/usr/bin/env node
process.exit(0);
process.on('SIGINT', () => {
console.log('Got SIGINT');
process.exit(1);
});