Skip to content

Commit 9dda9e8

Browse files
mquandalleclaude
andcommitted
feat: use machine format when run by Claude Code
Fixes #2868 Co-Authored-By: Claude <[email protected]>
1 parent 6ad05e5 commit 9dda9e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/svelte-check/src/options.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ const outputFormats = ['human', 'human-verbose', 'machine', 'machine-verbose'] a
9999
type OutputFormat = (typeof outputFormats)[number];
100100

101101
function getOutputFormat(opts: Record<string, any>): OutputFormat {
102-
return outputFormats.includes(opts.output) ? opts.output : 'human-verbose';
102+
if (outputFormats.includes(opts.output)) {
103+
return opts.output;
104+
} else if (process.env.CLAUDECODE === '1') {
105+
// https://github.com/sveltejs/language-tools/issues/2868
106+
return 'machine';
107+
} else {
108+
return 'human-verbose';
109+
}
103110
}
104111

105112
function getWorkspaceUri(opts: Record<string, any>) {

0 commit comments

Comments
 (0)