Skip to content

Commit 326f231

Browse files
committed
update
1 parent 303f74f commit 326f231

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.changeset/sixty-cars-fail.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'eslint-plugin-svelte': patch
2+
'eslint-plugin-svelte': minor
33
---
44

5-
fix: ignore `$state` in the `prefer-const` rule
5+
feat: add `excludedRunes` option to the `prefer-const` rule

docs/rules/prefer-const.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ This rule reports the same as the base ESLint `prefer-const` rule, except that i
4646
"error",
4747
{
4848
"destructuring": "any",
49-
"ignoreReadonly": true
49+
"ignoreReadonly": true,
50+
"excludedRunes": ["$props", "$state"]
5051
}
5152
]
5253
}
@@ -56,6 +57,7 @@ This rule reports the same as the base ESLint `prefer-const` rule, except that i
5657
- `any` (default): if any variables in destructuring should be const, this rule warns for those variables.
5758
- `all`: if all variables in destructuring should be const, this rule warns the variables. Otherwise, ignores them.
5859
- `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.
5961

6062
## :books: Further Reading
6163

0 commit comments

Comments
 (0)