Skip to content

Commit e3f7eb7

Browse files
committed
refactor: remove process.exit() calls per CLAUDE.md conventions
Replace process.exit() with throw statements and process.exitCode to follow project conventions. CLAUDE.md explicitly forbids process.exit() except in very limited cases. Changes: - scripts/test.mjs: Remove redundant process.exit() calls - scripts/cover.mjs: Throw error instead of process.exit() - scripts/maintenance/taze.mjs: Use process.exitCode instead of process.exit() Resolves quality scan issues #17-21 (process.exit violations).
1 parent 923698b commit e3f7eb7

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

scripts/cover.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ const buildResult = await spawn('node', ['scripts/build.mjs'], {
5454
env: envWithMemoryLimits,
5555
})
5656
if (buildResult.code !== 0) {
57-
logger.error('Build with source maps failed')
58-
process.exitCode = 1
59-
process.exit(1)
57+
throw new Error('Build with source maps failed')
6058
}
6159
logger.log('')
6260

scripts/maintenance/taze.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function main() {
5454
' Configure your dependencies to maintain provenance or exclude problematic packages.',
5555
)
5656

57-
process.exit(1)
57+
process.exitCode = 1
5858
}
5959
})
6060

scripts/test.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,10 @@ async function main() {
437437
spinner.stop()
438438
} catch {}
439439
removeExitHandler()
440-
// Explicitly exit to prevent hanging
441-
process.exit(process.exitCode || 0)
442440
}
443441
}
444442

445443
main().catch(error => {
446444
logger.error(error)
447-
process.exit(1)
445+
process.exitCode = 1
448446
})

0 commit comments

Comments
 (0)