Skip to content

Files

Latest commit

 

History

History
31 lines (20 loc) · 718 Bytes

no-reactive-literals.md

File metadata and controls

31 lines (20 loc) · 718 Bytes

Pattern: Unnecessary literal in reactive statement

Issue: -

Description

This rule reports on any assignment of a static, unchanging value within a reactive statement because it's not necessary.

<script>
  /* eslint svelte/no-reactive-literals: "error" */
  /* ✓ GOOD */
  let foo = 'bar';

  /* ✗ BAD */
  $: foo = 'bar';
</script>

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation