You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+1
Original file line number
Diff line number
Diff line change
@@ -430,6 +430,7 @@ These rules relate to better ways of doing things to help you avoid problems:
430
430
|[svelte/require-event-dispatcher-types](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-event-dispatcher-types/)| require type parameters for `createEventDispatcher`||
431
431
|[svelte/require-optimized-style-attribute](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-optimized-style-attribute/)| require style attributes that can be optimized ||
432
432
|[svelte/require-stores-init](https://sveltejs.github.io/eslint-plugin-svelte/rules/require-stores-init/)| require initial value in store ||
433
+
|[svelte/signal-prefer-let](https://sveltejs.github.io/eslint-plugin-svelte/rules/signal-prefer-let/)| use let instead of const for signals values |:wrench:|
433
434
|[svelte/valid-each-key](https://sveltejs.github.io/eslint-plugin-svelte/rules/valid-each-key/)| enforce keys to use variables defined in the `{#each}` block ||
description: 'use let instead of const for signals values'
6
+
---
7
+
8
+
# svelte/signal-prefer-let
9
+
10
+
> use let instead of const for signals values
11
+
12
+
-:exclamation: <badgetext="This rule has not been released yet."vertical="middle"type="error"> **_This rule has not been released yet._** </badge>
13
+
-:wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
14
+
15
+
## :book: Rule Details
16
+
17
+
This rule reports whenever a signal is assigned to a const.
18
+
In JavaScript `const` are defined as immutable references which cannot be reassigned.
19
+
Signals are by definition changing and are reassigned by Svelte's reactivity system.
0 commit comments