fix: enable svelte a11y linting and fix violations
This commit is contained in:
@@ -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'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user