pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
svelte/no-extra-reactive-curlies |
disallow wrapping single reactive statements in curly braces |
v2.4.0 |
disallow wrapping single reactive statements in curly braces
- 💡 Some problems reported by this rule are manually fixable by editor suggestions.
This rule reports if curly brackets ({
and }
) are used unnecessarily around a reactive statement body containing only a single expression.
<script>
/* eslint svelte/no-extra-reactive-curlies: "error" */
/* ✓ GOOD */
$: foo = 'red';
/* ✗ BAD */
$: {
foo = 'red';
}
</script>
Nothing.
This rule was taken from @tivac/eslint-plugin-svelte.
This rule is compatible with @tivac/svelte/reactive-curlies
rule.
This rule was introduced in eslint-plugin-svelte v2.4.0