From d3069110fe54cee4bd33e862132a73e0bde282c9 Mon Sep 17 00:00:00 2001 From: Ranjan Mohanty Date: Mon, 16 Nov 2026 00:23:17 +0100 Subject: [PATCH] Codacy: stdout error listener reports with console.error Validated with ESLint 8 + eslint-plugin-security-node, the rule Codacy runs. Co-Authored-By: Claude Opus 5.5 --- src/bin.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin.ts b/src/bin.ts index fd0197e..ef040c7 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -3,8 +3,9 @@ import { main } from './cli.js'; // `agent-ready | head` closes stdout early; exit quietly instead of crashing on EPIPE. process.stdout.on('error', (err: NodeJS.ErrnoException) => { - if (err.code !== 'EPIPE') process.stderr.write(`agent-ready: ${err.message}\n`); - process.exit(err.code === 'EPIPE' ? 0 : 1); + if (err.code === 'EPIPE') process.exit(0); + console.error(`agent-ready: ${err.message}`); + process.exit(1); }); main(process.argv.slice(2)).then(