sveltejs/language-tools

svelte-vscode does not support new warning names

Closed this issue · 2 comments

Describe the bug

VScode highlights "wrong" code even if it was ignored using new warning names (with underscores).

Reproduction

  1. Use this component
        <!-- svelte-ignore a11y_click_events_have_key_events  -->
        <!-- svelte-ignore a11y_no_static_element_interactions -->
        <md-menu-item on:click={() => {}></ md-menu-item>
  1. Observe VSCode warnings:
A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.svelte(a11y-click-events-have-key-events)
A11y: <md-menu-item> with click handler must have an ARIA rolesvelte(a11y-no-static-element-interactions)
  1. Run svelte-check and eslint ., ensure that there is no actual warning.
  2. Use Quick Fix (it generates svelte-ignore comments)
  3. Generated comments are old-styled, making eslint-plugin-svelte to cry.

Expected behaviour

VSCode should not report an error if it is ignored

System Info

  • @sveltejs/kit@2.5.7
  • @sveltejs/vite-plugin-svelte@4.0.0-next.1
  • svelte@5.0.0-next.133
  • vite@5.0.10
  • eslint-plugin-svelte@2.39.0
  • svelte-check@^3.7.1

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

image

The svelte compiler provides the a11y warnings. So you're likely running an older version of the svelte compiler in your editor. Typically this is because:

  1. You updated the compiler while the language server is running. This will require a language server restart. This is probably the most likely situation.
  2. You have Restricted Mode enabled.
  3. Your local Svelte can't be loaded. It's likely because it is a dependency of other libraries and you're using pnpm.

In 2 and 3, the language server only uses the bundled Svelte 3. If none of this applies, Please provide a reproduction repository.

Thanks, that was the first case. After the VS Code window reloading it does not report the warning anymore. From my point of view, the issue can be closed.