markup_fmt
markup_fmt copied to clipboard
fmt(svelte): formatter error on dynamic style in svelte
Version Deno 2.1.1
<script lang="ts">
const { color }: { color: string | null } = $props();
</script>
<div
style="background-color: {color || 'blueviolet'};"
>
</div>
deno fmt --unstable-component
Error formatting: C:\temp\deno-init\test.svelte
syntax error at line 6, col 28: expect token `<ident>`, but found `{`
Checked 4 files
Originally reported in https://github.com/denoland/deno/issues/26999
This is a known issue, but hard to fix at this moment.
It's not quite idiomatic Svelte. It could be better written as:
<div style:background-color={color || 'blueviolet'}></div>