svelte icon indicating copy to clipboard operation
svelte copied to clipboard

Named slots breaks svelte-ignore comments

Open TimoWilhelm opened this issue 2 years ago • 1 comments

Describe the bug

When adding a named slot to an element, the svelte-ignore comment does not work.

Reproduction

Run svelte-check

Error:

  <!-- svelte-ignore a11y-click-events-have-key-events -->
  <div slot="content" on:click />

Works:

  <!-- svelte-ignore a11y-click-events-have-key-events -->
  <div on:click />

Expected behaviour

I would expect svelte-ignore comments to also apply to named slot elements.

System Info

  • OS: Windows
  • IDE: VSCode
  • "svelte-check": "2.9.2"

Which package is the issue about?

None

Additional Information, eg. Screenshots

image

TimoWilhelm avatar Dec 02 '22 17:12 TimoWilhelm

Seems like a bug so I retain the bug tag before the transfer. It seems to be related to the svelte:fragment implementation

Ignore comment works on the element with slot attribute in 3.34 https://svelte.dev/repl/24a2b8854bbb46c58358c5ade09c8d50?version=3.34.0

But not in the 3.35 or the latest. https://svelte.dev/repl/24a2b8854bbb46c58358c5ade09c8d50?version=3.35.0 https://svelte.dev/repl/24a2b8854bbb46c58358c5ade09c8d50?version=3.53.1

jasonlyu123 avatar Dec 03 '22 02:12 jasonlyu123

This should be fixed in 3.55.1 - https://svelte.dev/repl/24a2b8854bbb46c58358c5ade09c8d50?version=3.55.1

Conduitry avatar Jan 10 '23 17:01 Conduitry