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: docs/rules/prefer-const.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ since: 'v3.0.0-next.6'
14
14
15
15
## :book: Rule Details
16
16
17
-
This rule reports the same as the base ESLint `prefer-const` rule, except that ignores Svelte reactive values such as `$derived` and `$props`. If this rule is active, make sure to disable the base `prefer-const` rule, as it will conflict with this rule.
17
+
This rule reports the same as the base ESLint `prefer-const` rule, except that ignores Svelte reactive values such as `$derived` and `$props` as default. If this rule is active, make sure to disable the base `prefer-const` rule, as it will conflict with this rule.
18
18
19
19
<!--eslint-skip-->
20
20
@@ -46,7 +46,8 @@ This rule reports the same as the base ESLint `prefer-const` rule, except that i
46
46
"error",
47
47
{
48
48
"destructuring": "any",
49
-
"ignoreReadonly": true
49
+
"ignoreReadonly": true,
50
+
"excludedRunes": ["$props", "$derived"]
50
51
}
51
52
]
52
53
}
@@ -56,6 +57,7 @@ This rule reports the same as the base ESLint `prefer-const` rule, except that i
56
57
-`any` (default): if any variables in destructuring should be const, this rule warns for those variables.
57
58
-`all`: if all variables in destructuring should be const, this rule warns the variables. Otherwise, ignores them.
58
59
-`ignoreReadonly`: If `true`, this rule will ignore variables that are read between the declaration and the _first_ assignment.
60
+
-`excludedRunes`: An array of rune names that should be ignored. Even if a rune is declared with `let`, it will still be ignored.
0 commit comments