From 9dda9e88a3d689d18b973d646ad92a51e2f29449 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sat, 18 Oct 2025 06:57:46 +0200 Subject: [PATCH] feat: use machine format when run by Claude Code Fixes #2868 Co-Authored-By: Claude --- packages/svelte-check/src/options.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/svelte-check/src/options.ts b/packages/svelte-check/src/options.ts index b8ceca8f2..a8a347db8 100644 --- a/packages/svelte-check/src/options.ts +++ b/packages/svelte-check/src/options.ts @@ -99,7 +99,14 @@ const outputFormats = ['human', 'human-verbose', 'machine', 'machine-verbose'] a type OutputFormat = (typeof outputFormats)[number]; function getOutputFormat(opts: Record): OutputFormat { - return outputFormats.includes(opts.output) ? opts.output : 'human-verbose'; + if (outputFormats.includes(opts.output)) { + return opts.output; + } else if (process.env.CLAUDECODE === '1') { + // https://github.com/sveltejs/language-tools/issues/2868 + return 'machine'; + } else { + return 'human-verbose'; + } } function getWorkspaceUri(opts: Record) {