Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

30 lines (21 sloc) 790 Bytes

Make the same code path as throw at process.exit() (process-exit-as-throw)

Rule Details

function foo(a) {
    if (a) {
        return new Bar();
    } else {
        process.exit(1);
    }
}

ESLint does not address process.exit() as stop in code path analysis, then consistent-return rule will warn the above code.

If you turn this rule on, ESLint comes to address process.exit() as throw in code path analysis. So, above code will get expected code path.

This rule itself never warn code.

Related Rules

You can’t perform that action at this time.