Repository: oclif/core (ts)

Issue:
this.exit(0) no longer exits in v3
**Describe the bug**
`this.exit(0)` used to exit with a code of zero in v2. In v3, this behavior has changed in that a command no longer exits.

**To Reproduce**
Reproduction repository: https://github.com/maxbeatty/reproduce-oclif-test-exit-zero

Simple command that can exit in different ways:
https://github.com/maxbeatty/reproduce-oclif-test-exit-zero/blob/2dfa70a1ab80b057167c3f4a9eb1f58701b125cc/src/commands/hello/index.ts#L20-L40

Tests for exit logic:
https://github.com/maxbeatty/reproduce-oclif-test-exit-zero/blob/2dfa70a1ab80b057167c3f4a9eb1f58701b125cc/test/commands/hello/index.test.ts#L11-L32

CI failure:
https://github.com/maxbeatty/reproduce-oclif-test-exit-zero/actions/runs/6670925950/job/18131787718

Downgrading to v2 restores expected behavior:
- https://github.com/maxbeatty/reproduce-oclif-test-exit-zero/pull/2/files
- https://github.com/maxbeatty/reproduce-oclif-test-exit-zero/actions/runs/6670912544/job/18131748129

**Expected behavior**
`this.exit(code)` should exit the command with the given code.

**Environment (please complete the following information):**
 - OS & version: observed locally in macOS and in GitHub Actions on Ubuntu
 - Shell/terminal & version: _does not seem to be related_


Pull request description:
fix: restore exit(0) behavior
Fixes #846 

Patch:
diff --git a/src/command.ts b/src/command.ts
index 1f7e103..b93afb8 100644
--- a/src/command.ts
+++ b/src/command.ts
@@ -210,9 +210,7 @@ export abstract class Command {
     return Errors.error(input, options as any)
   }
 
-  public exit(code: number): never
-  public exit(code: 0): void
-  public exit(code = 0): void | never {
+  public exit(code = 0): never {
     Errors.exit(code)
   }
 
diff --git a/src/errors/index.ts b/src/errors/index.ts
index 873d616..ce120a5 100644
--- a/src/errors/index.ts
+++ b/src/errors/index.ts
@@ -11,10 +11,8 @@ export {ExitError} from './errors/exit'
 export {ModuleLoadError} from './errors/module-load'
 export {handle} from './handle'
 
-export function exit(code = 0) {
-  if (code !== 0) {
-    throw new ExitError(code)
-  }
+export function exit(code = 0): never {
+  throw new ExitError(code)
 }
 
 export function error(input: Error | string, options: {exit: false} & PrettyPrintableError): void


Test patch:
diff --git a/test/command/command.test.ts b/test/command/command.test.ts
index c86f333..35f33ea 100644
--- a/test/command/command.test.ts
+++ b/test/command/command.test.ts
@@ -68,7 +68,8 @@ describe('command', () => {
 
       return Command.run([])
     })
-    .it('exits with 0 does not throw error')
+    .catch(/EEXIT: 0/)
+    .it('exits with 0')
 
   describe('parse', () => {
     fancy.stdout().it('has a flag', async (ctx) => {