Skip to content

Commit 7185245

Browse files
authored
fix: tsc-strict does not return a failure exit code with SIGABRT (#76)
According to execa docs the error might contain an undefined exitCode when it gets killed by a signal or fails when spawning. https://github.com/sindresorhus/execa/blob/main/docs/errors.md#exit-code To test I did the following locally to simulate the TSC getting out of memory: ``` NODE_OPTIONS="--max-old-space-size=512" ../node_modules/.bin/tsc-strict ```
1 parent 970116f commit 7185245

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cli/typescript/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const compile = async (): Promise<string> => {
3030
if (isExecaError(error) && error.all) {
3131
if (wasCompileAborted(error)) {
3232
console.log(`💥 Typescript task was aborted. Full error log: `, error.all);
33-
process.exit(error.exitCode);
33+
process.exit(error.exitCode ?? 1);
3434
}
3535

3636
compilerOutputCache = error.all;

0 commit comments

Comments
 (0)