fix: enable svelte a11y linting and fix violations

This commit is contained in:
2026-07-11 12:41:10 +01:00
parent d412dc3cc4
commit d172adf392
11 changed files with 57 additions and 6 deletions
+17
View File
@@ -29,5 +29,22 @@ export default defineConfig(
svelteConfig
}
}
},
{
name: 'svelte:a11y:rules',
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
rules: {
// Compile all .svelte files and surface compiler warnings as ESLint errors.
// The Svelte 5 compiler has built-in a11y checks (a11y_missing_attribute,
// a11y_click_events_have_key_events, a11y_no_static_element_interactions, etc.)
// that are enabled by default via accessibilityWarnings: true.
'svelte/valid-compile': 'error',
// Require explicit type attribute on <button> elements
'svelte/button-has-type': 'error',
// Require rel="noopener noreferrer" with target="_blank"
'svelte/no-target-blank': 'error'
}
}
);