Skip to content

Commit 16d8454

Browse files
mquandalleclaudedummdidumm
authored
feat: use machine format when run by Claude Code (#2870)
* feat: use machine format when run by Claude Code Fixes #2868 Co-Authored-By: Claude <noreply@anthropic.com> * Change commit type from feat to chore --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 parent 6a8ef1a commit 16d8454

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/old-carrots-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-check": patch
3+
---
4+
5+
chore: use machine format when run by Claude Code

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)