pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
svelte/no-reactive-literals |
don't assign literal values in reactive statements |
v2.4.0 |
don't assign literal values in reactive statements
- ⚙️ This rule is included in
"plugin:svelte/recommended"
. - 💡 Some problems reported by this rule are manually fixable by editor suggestions.
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>
Nothing.
This rule was taken from @tivac/eslint-plugin-svelte.
This rule is compatible with @tivac/svelte/reactive-literals
rule.
This rule was introduced in eslint-plugin-svelte v2.4.0