💼 This rule is enabled in the following configs: 🟢 recommended-module
, ✅ recommended-script
.
function foo(a) {
if (a) {
return new Bar();
} else {
process.exit(1);
}
}
ESLint does not mark code after process.exit()
calls as unreachable like it does with throw
and return
expressions, meaning rules like consistent-return will still warn.
This rule overrides the default code path analyzer so that code after process.exit()
calls are marked as unreachable, meaning code like the above will not trigger warnings.
This rule itself never warn code.