Svelte allows for components with two script tags, so long as one is a <script module>.
<script lang='ts' module>
...
<script lang='ts'>
If you do this however, prettier complains and will stop formatting documents, saying:
ParseError: A component can only have one instance-level <script> element
The solution is to use deprecated syntax to achieve the same result:
<script lang='ts' context='module'>
<script lang='ts'>
However this produces a svelte linter warning at the top of the documents:
context="module" is deprecated, use the 'module' attribute instead
After making this change, prettier formatting starts working again.