Skip to content
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

Rule deprecation request #894

Open
marekdedic opened this issue Oct 29, 2024 · 5 comments · May be fixed by #899
Open

Rule deprecation request #894

marekdedic opened this issue Oct 29, 2024 · 5 comments · May be fixed by #899

Comments

@marekdedic
Copy link
Contributor

marekdedic commented Oct 29, 2024

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
  • svelte/experimental-require-slot-types - Slots are deprecated
  • svelte/experimental-require-strict-events - Events are deprecated and the strictEvents attribute is removed outright in Svelte v5
  • svelte/no-not-function-handler - Callbacks are regular props in Svelte 5 and thus are checked by TS.
@marekdedic
Copy link
Contributor Author

marekdedic commented Oct 30, 2024

Is there some major version planned? (v3 maybe? :D) I could add a PR for this...

@ota-meshi
Copy link
Member

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
Copy link
Member

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
Copy link
Contributor Author

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...

@marekdedic
Copy link
Contributor Author

Actually, infinite-reactive-loop should be included in the list as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants