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
Hi, I'm starting to update my projects to Svelte v5 and noticed that some of the rules I added were no longer relevant or outright incorrect. While at it, I went over all rules and I propose to deprecate the following ones (and eventually remove them once Svelte does so):
svelte/no-dupe-on-directives - duplicate directives now cause an error in Svelte itself, no need for a lint rule.
svelte/no-dynamic-slot-name - slots are deprecated and snippets can't have a dynamic name afaik
svelte/no-reactive-reassign - Reactive statements are deprecated
svelte/no-immutable-reactive-statements - Reactive statements are deprecated
svelte/no-reactive-functions - Reactive statements are deprecated
svelte/no-reactive-literals - Reactive statements are deprecated
svelte/require-event-dispatcher-types - Events are deprecated
We plan to make the next release a major version 👍
Therefore, we plan to make many breaking changes, such as making it ESM-only and droping support for older versions of ESLint, Node, etc.
Svelte 5 supports Svelte4 features, therefore I think we can remove these rules in Svelte6 or 7.
But we can remove from recommended rules.
Maybe we need to make a new config for recommended rules of Svelte4?
Ok, I'll make a PR. Let's deprecate the rules for now and remove them some time in the future (presumably after Svelte removes the deprecated features).
I think it would be a good idea to review the recommended config for a new major version anyway. (Maybe add some new rules as well?) But I'll remove any deprecated rules from it.
As an aside, I am looking into the three no-reactive-* rules and whether it would make sense to add similar rules for runes. It seems to me that no-reactive-literals and no-reactive-reassign don't make sense, but no-reactive-functions maybe does? I mean, you probably shouldn't define functions in $derived and $effect, right? If so, let's open a new issue for that and track it separately...
Activity
marekdedic commentedon Oct 30, 2024
Is there some major version planned? (v3 maybe? :D) I could add a PR for this...
ota-meshi commentedon Oct 31, 2024
We plan to make the next release a major version 👍
Therefore, we plan to make many breaking changes, such as making it ESM-only and droping support for older versions of ESLint, Node, etc.
baseballyama commentedon Oct 31, 2024
Svelte 5 supports Svelte4 features, therefore I think we can remove these rules in Svelte6 or 7.
But we can remove from recommended rules.
Maybe we need to make a new config for recommended rules of Svelte4?
marekdedic commentedon Oct 31, 2024
Ok, I'll make a PR. Let's deprecate the rules for now and remove them some time in the future (presumably after Svelte removes the deprecated features).
I think it would be a good idea to review the recommended config for a new major version anyway. (Maybe add some new rules as well?) But I'll remove any deprecated rules from it.
As an aside, I am looking into the three
no-reactive-*rules and whether it would make sense to add similar rules for runes. It seems to me thatno-reactive-literalsandno-reactive-reassigndon't make sense, butno-reactive-functionsmaybe does? I mean, you probably shouldn't define functions in$derivedand$effect, right? If so, let's open a new issue for that and track it separately...marekdedic commentedon Nov 3, 2024
Actually,
infinite-reactive-loopshould be included in the list as well!