Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(process-exit-as-throw): update wording #323

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/rules/process-exit-as-throw.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function foo(a) {
}
```

ESLint does not address `process.exit()` as stop in code path analysis, then [consistent-return] rule will warn the above code.
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.

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 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.

Expand Down