Skip to content

chore: do not run no-reactive-reassign rule on Svelte 5 with runes #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/perfect-mirrors-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-svelte': patch
---

chore: do not run `no-reactive-reassign` rule on Svelte 5 with runes
11 changes: 10 additions & 1 deletion packages/eslint-plugin-svelte/src/rules/no-reactive-reassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
docs: {
description: 'disallow reassigning reactive values',
category: 'Possible Errors',
// TODO Switch to recommended in the major version.

Check warning on line 12 in packages/eslint-plugin-svelte/src/rules/no-reactive-reassign.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO Switch to recommended in the major...'
recommended: false
},
schema: [
Expand All @@ -27,7 +27,16 @@
assignmentToReactiveValue: "Assignment to reactive value '{{name}}'.",
assignmentToReactiveValueProp: "Assignment to property of reactive value '{{name}}'."
},
type: 'problem'
type: 'problem',
conditions: [
{
svelteVersions: ['3/4']
},
{
svelteVersions: ['5'],
runes: [false, 'undetermined']
}
]
},
create(context) {
const props = context.options[0]?.props !== false; // default true
Expand Down
Loading