Skip to content

Commit

Permalink
chore(type): specify that programError() never returns, aiding typing
Browse files Browse the repository at this point in the history
This extra type spec means we don't have to add 'undefined' to functions
that don't explicitly return when calling programError()
  • Loading branch information
doublethefish authored and raineorshine committed Dec 11, 2022
1 parent c42b5b5 commit 7d0d266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/programError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { print } from '../lib/logging'
import { Options } from '../types/Options'

/** Print an error. Exit the process if in CLI mode. */
function programError(options: Options, message: string) {
function programError(options: Options, message: string): never {
if (options.cli) {
print(options, message, null, 'error')
process.exit(1)
Expand Down

0 comments on commit 7d0d266

Please sign in to comment.