Is this new in Sveltekit July 2023? I've used Sveltekit many times and I opened some old components in a new sveltekit project and I'm getting a lot of Aria Role errors. I know I can use !-- svelte-ignore a11y-no-static-element-interactions --> but that works for only one component page. How can I disable all the errors popping up in my terminal? I don't agree with it, in general I simply don't want to follow the "rules". Do I make changes in vite.config.js, or svelte.config.js?
Looks like there's an onwarn flag you can use in svelte.config.js, according to the vite-plugin-svelte docs:
export default defineConfig({
plugins: [
svelte({
onwarn(warning, defaultHandler) {
// don't warn on <marquee> elements, cos they're cool
if (warning.code === 'a11y-distracting-elements') return;
// handle all other warnings normally
defaultHandler(warning);
}
})
]
});
That's the example from the docs, clearly you'd update the warning:
export default defineConfig({
plugins: [
svelte({
onwarn(warning, defaultHandler) {
if (warning.code === 'a11y-no-static-element-interactions') return;
// handle all other warnings normally
defaultHandler(warning);
}
})
]
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With