Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: false positives for mutable member in `svelte/no-immutable-react…
…ive-statements` rule (#581)
- Loading branch information
Showing
4 changed files
with
70 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-svelte": patch | ||
--- | ||
|
||
fix: false positives for mutable member in `svelte/no-immutable-reactive-statements` rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ build | |
/lib | ||
.npmrc | ||
/tests/fixtures/rules/indent/valid/ | ||
.changeset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/fixtures/rules/no-immutable-reactive-statements/valid/mutable-member-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
const array = [1]; | ||
const object = { b: 1 }; | ||
$: a = array[0]; | ||
$: b = object.b; | ||
</script> | ||
|
||
{a}{b} | ||
<button on:click={() => (array[0] = 2)}>Foo</button> | ||
<button on:click={() => (object.b = 2)}>Foo</button> |