Ignore Accessibility Warnings in Svelte

- 1 minute read

Svelte has a special keyword you can prefix your HTML comments with, svelte-ignore, which will ignore warnings from the compiler.

Chances are, the warnings you want to ignore will typically be accessibility warnings.

Here is a comment using svelte-ignore, thereby disabling the warning the Svelte compiler would have otherwise displayed:

<!-- svelte-ignore -->
<a role="button">This link doesn't need an href attribute! But the compiler will complain about it anyway.</a>

Be sure you know what you are doing when you disable accessibility warnings! Or any kind of warning, for that matter.

Link to this section Conclusion

Anyway, hopefully this helped you out! And hopefully this makes your console a bit cleaner as well.