Describe the bug
When a .svelte file begins with an HTML comment wrapping a JSDoc block like this:
<!--
/**
* @component MyComponent
* @description Some description.
*/
-->
<script lang="ts">
// ...
</script>
the svelte2tsx emit in --incremental / --tsgo mode generates a malformed .svelte.ts file containing nested
JSDoc:
/**
* /**
* * MyComponent
* * Some description.
* */
*/
This produces syntax errors (TS1109, TS1161) in the generated file, which causes the spawned tsc / tsgo
process to fail in a way that silently suppresses all other diagnostics — including errors in completely
unrelated .ts and .svelte files. svelte-check then reports 0 errors and 0 warnings.
Normal mode (without --incremental / --tsgo) is unaffected because it uses the language server path rather than the generated overlay project.
Reproduction
- Create a .svelte file with an HTML comment containing a JSDoc block (as above)
- Introduce a type error in any other .ts or .svelte file
- Run svelte-check --tsconfig tsconfig.json --incremental (or --tsgo)
- Observe 0 errors — the type error is silently missed
- Remove the HTML-wrapped JSDoc comment and rerun — the error is now reported
Expected behaviour
If this type of comment is not allowed, it should raise an error. If it is allowed, it should be handled correctly.
System Info
- OS: CachyOS (Arch)
- IDE: N/A
Which package is the issue about?
svelte-check
Additional Information, eg. Screenshots
svelte-check version 4.4.5
Describe the bug
When a .svelte file begins with an HTML comment wrapping a JSDoc block like this:
the svelte2tsx emit in --incremental / --tsgo mode generates a malformed .svelte.ts file containing nested
JSDoc:
This produces syntax errors (TS1109, TS1161) in the generated file, which causes the spawned tsc / tsgo
process to fail in a way that silently suppresses all other diagnostics — including errors in completely
unrelated .ts and .svelte files. svelte-check then reports 0 errors and 0 warnings.
Normal mode (without --incremental / --tsgo) is unaffected because it uses the language server path rather than the generated overlay project.
Reproduction
Expected behaviour
If this type of comment is not allowed, it should raise an error. If it is allowed, it should be handled correctly.
System Info
Which package is the issue about?
svelte-check
Additional Information, eg. Screenshots
svelte-check version 4.4.5