LSP doesn't accept TypeScript in specific files.

I haven't found anything interesting in LSP logs, and my Svelte configuration is a default one except for the TypeScript preprocessor. svelte-check with --tsconfig shows no errors and my app builds just fine, so it's the LSP doing something weird and not me.
I removed this and that and determined that this short component reproduces the issue:
<main>{String(q).replace(/(ssh|git):\/\//, 'https://')}</main>
<script lang="ts">
let q: number = $state(1);
</script>
Specifically the regex causes LSP to treat the file as a JS component.
Tokenization also seems to be incorrect here:

LSP doesn't accept TypeScript in specific files.

I haven't found anything interesting in LSP logs, and my Svelte configuration is a default one except for the TypeScript preprocessor.
svelte-checkwith--tsconfigshows no errors and my app builds just fine, so it's the LSP doing something weird and not me.I removed this and that and determined that this short component reproduces the issue:
Specifically the regex causes LSP to treat the file as a JS component.
Tokenization also seems to be incorrect here: