Skip to content

Files

Latest commit

 

History

History
41 lines (26 loc) · 1005 Bytes

no-extra-reactive-curlies.md

File metadata and controls

41 lines (26 loc) · 1005 Bytes

Pattern: Wrapping single reactive statement in curly braces

Issue: -

Description

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>

🔧 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