From cbf7ec2ef1c5fb9cea2bf6c3cba1860ee22b94bf Mon Sep 17 00:00:00 2001 From: Bart Veneman Date: Mon, 3 Nov 2025 20:54:22 +0100 Subject: [PATCH] feat: add JSON reporter --- src/cli/arguments.ts | 1 + src/cli/cli.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/cli/arguments.ts b/src/cli/arguments.ts index 90dba63..d6efaf3 100644 --- a/src/cli/arguments.ts +++ b/src/cli/arguments.ts @@ -10,6 +10,7 @@ const show_uncovered_options = { const reporters = { pretty: 'pretty', tap: 'tap', + json: 'json', } as const let CoverageDirSchema = v.pipe(v.string(), v.nonEmpty()) diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 02cd33b..30f189d 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -24,6 +24,10 @@ async function cli(cli_args: string[]) { if (params.reporter === 'tap') { return tap(report, params) } + if (params.reporter === 'json') { + // oxlint-disable-next-line no-null + return console.log(JSON.stringify(report)) + } return pretty(report, params) }