sveltejs / cli

The Svelte CLI
MIT License
258 stars 11 forks source link

svelte-migrate should remove `strictEvents` #277

Open marekdedic opened 2 weeks ago

marekdedic commented 2 weeks ago

Describe the bug

Hi, Svelte 4 supported the strictEvents attribute on the <script> element:

<script lang="ts" strictEvents>
</script>

In Svelte 5, this is no longer supported. Thus, svelte-migrate should remove this attribute

Reproduction

I don't know how to create a repro repo for svelte-migrate

Logs

No response

System Info

System:
    OS: Linux 6.5 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1265U
    Memory: 7.59 GB / 15.22 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 22.11.0 - /usr/bin/node
    Yarn: 1.22.21 - /usr/bin/yarn
    npm: 10.9.0 - /usr/bin/npm
    pnpm: 8.15.8 - /usr/bin/pnpm
  npmPackages:
    svelte: ^5.0.0 => 5.1.11

Severity

annoyance

Additional Information

No response

benmccann commented 2 weeks ago

I honestly have no idea what strictEvents is. I don't see it on svelte.dev at all or the Svelte 5 migration guide, so adding it to the migration guide might be a good first step

marekdedic commented 2 weeks ago

Yeah, this is something that was implemented, but never properly documented. Anyway, more info is here:

https://github.com/dummdidumm/rfcs/blob/ts-typedefs-within-svelte-components/text/ts-typing-props-slots-events.md#typing-events