Enable just the quoting behavior from strict mode

#279

Development PRs

Issue

Solved
O
ohmree
Mar 4, 2022, 9:59 PM

Given the following example:

<input {value} on:input="{(ev) => console.log(ev.currentTarget.value)}" />

Formatting with strict mode turned off will result in the following output:

<input {value} on:input={(ev) => console.log(ev.currentTarget.value)} />

While having it on will result in the following output:

<input value="{value}" on:input="{(ev) => console.log(ev.currentTarget.value)}" />

Now my editor plugin that handles svelte syntax highlighting (emacs web-mode) is an ungodly mess of spaghetti code and regexes and doesn't like unquoted curly braces so I'd like to enforce quotes around them, while still using shorthand attributes and self-closing tags where strict mode wouldn't allow them. Can an option be added that enables just the quoting behavior from strict mode?

Info

Closed at Jul 17, 2023, 11:13 AM
Assignees None
Labels None
Milestone None