Skip to content

no-unused-svelte-ignore false positive for a11y warnings on elements with inner element #386

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

Closed
2 tasks done
DetachHead opened this issue Mar 1, 2023 · 2 comments · Fixed by #387
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Mar 1, 2023

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.35.0

What version of eslint-plugin-svelte are you using?

2.19.1

What did you do?

Configuration
plugin:svelte/recommended
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<span tabindex="0">
    <span class="element" />
</span>

What did you expect to happen?

no error, as the compile warning is being suppressed by the svelte-ignore comment

What actually happened?

[1:20]: svelte-ignore comment is used, but not warned (svelte/no-unused-svelte-ignore)
[2:1]: A11y: noninteractive element cannot have nonnegative tabIndex value(a11y-no-noninteractive-tabindex) (svelte/valid-compile)

Link to GitHub Repo with Minimal Reproducible Example

https://ota-meshi.github.io/eslint-plugin-svelte/playground/#eJw1y8EKgzAQhOFX2e59sV7F+iS5rHEogXRTzCKW4rsbKYU5fT/z5VgW8MDjTYTqhuyQ9LSygrTvP2KlzZI5Vo2eNojrnGzBTiJTsLG+1ehvj8D3wI2JfiFmrbUpMl4wD0zddequOPFxAsAxKvI=

Additional comments

the selte/valid-compile warning appears even though the svelte-ignore comment successfully suppresses the warning when running svelte-check

@DetachHead DetachHead changed the title no-unused-svelte-ignore false positive on a11y-no-noninteractive-tabindex with inner element no-unused-svelte-ignore false positive for a11y warnings on elements with inner element Mar 1, 2023
@DetachHead
Copy link
Contributor Author

another example

<!-- svelte-ignore a11y-click-events-have-key-events -->
<div on:click={() => {}}>
  <span class="element" />
</div>

@ota-meshi
Copy link
Member

Thank you for the bug report. I will fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants