# svelte/no-extra-reactive-curlies

disallow wrapping single reactive statements in curly braces

  • 💡 Some problems reported by this rule are manually fixable by editor suggestions.

# 📖 Rule Details

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 */
  $: 
Do not wrap reactive statements in curly braces unless necessary. (svelte/no-extra-reactive-curlies)
{
foo = 'red'; } </script>

# 🔧 Options

Nothing.

# ❤️ Compatibility

This rule was taken from @tivac/eslint-plugin-svelte.
This rule is compatible with @tivac/svelte/reactive-curlies rule.

# 🚀 Version

This rule was introduced in eslint-plugin-svelte v2.4.0

# 🔍 Implementation