From d172adf392ccbd480a9353ab648cf9dc955da720 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Sat, 11 Jul 2026 12:41:10 +0100 Subject: [PATCH] fix: enable svelte a11y linting and fix violations --- frontend/eslint.a11y.config.js | 17 +++++++++++++++++ .../components/admin/BookingCreateModal.svelte | 3 +++ .../lib/components/admin/HolidayHours.svelte | 1 + .../components/admin/WalkInCreateModal.svelte | 3 +++ .../lib/components/layout/ContactCard.svelte | 2 +- .../src/lib/components/layout/NavBar.svelte | 3 ++- frontend/src/routes/account/+page.svelte | 10 ++++++++++ frontend/src/routes/admin/+page.svelte | 5 +++++ frontend/src/routes/gdpr/+page.svelte | 9 +++++---- frontend/src/routes/portfolio/+page.svelte | 9 +++++++++ frontend/src/routes/schedule/+page.svelte | 1 + 11 files changed, 57 insertions(+), 6 deletions(-) diff --git a/frontend/eslint.a11y.config.js b/frontend/eslint.a11y.config.js index ff9e8d1..baaf241 100644 --- a/frontend/eslint.a11y.config.js +++ b/frontend/eslint.a11y.config.js @@ -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