Skip to content

Rule deprecation request #894

Closed

Description

@marekdedic

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 (chore: execute svelte/experimental-require-slot-types only on Svelte 3 and 4 #1005)
  • 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.

Activity

  1. marekdedic commented on Oct 30, 2024

    @marekdedic
    ContributorAuthor

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

  2. ota-meshi commented on Oct 31, 2024

    @ota-meshi
    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.

  3. baseballyama commented on Oct 31, 2024

    @baseballyama
    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?

  4. marekdedic commented on Oct 31, 2024

    @marekdedic
    ContributorAuthor

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

  5. marekdedic commented on Nov 3, 2024

    @marekdedic
    ContributorAuthor

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

  6. added this to the v3 milestone on Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions