Skip to content

Commit 023bea3

Browse files
committed
Merge branch 'main' into setup-cli-project
2 parents 0e3b1ba + 7a6cba8 commit 023bea3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/mcp-server/src/mcp/handlers/tools/svelte-autofixer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ export function svelte_autofixer(server: SvelteMcp) {
6161
content.issues.push(
6262
`${error.message} at line ${error.start?.line}, column ${error.start?.column}`,
6363
);
64+
if (error.message.includes('js_parse_error')) {
65+
content.suggestions.push(
66+
"The code can't be compiled because a Javascript parse error. In case you are using runes like this `$state variable_name = 3;` or `$derived variable_name = 3 * count` that's not how runes are used. You need to use them as function calls without importing them: `const variable_name = $state(3)` and `const variable_name = $derived(3 * count)`.",
67+
);
68+
}
6469
}
6570

6671
if (content.issues.length > 0 || content.suggestions.length > 0) {

0 commit comments

Comments
 (0)