# svelte/no-object-in-text-mustaches
disallow objects in text mustache interpolation
- βοΈ This rule is included in
"plugin:svelte/recommended"
.
# π Rule Details
This rule disallows the use of objects in text mustache interpolation.
When you use an object for text interpolation, it is drawn as [object Object]
. Itβs almost always a mistake. You may have written a lot of unnecessary curly braces.
<script>
/* eslint svelte/no-object-in-text-mustaches: "error" */
</script>
<!-- β GOOD -->
{foo}
<input class="{foo} bar" />
<MyComponent prop={{ foo }} />
<!-- β BAD -->
Unexpected object in text mustache interpolation. (svelte/no-object-in-text-mustaches){{ foo }}
<input class="Unexpected object in text mustache interpolation. (svelte/no-object-in-text-mustaches){{ foo }} bar" />
# π§ Options
Nothing.
# π« Related Rules
# π Version
This rule was introduced in eslint-plugin-svelte v0.5.0