diff --git a/.gitignore b/.gitignore index 8a66126..933cb79 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,10 @@ backend/.DS_Store # 3. Node/Svelte (Frontend) # ------------------------------------ +# Root-level npm artifacts (from nested npm installs) +node_modules/ +package.json + # Dependencies frontend/node_modules diff --git a/frontend/eslint.a11y.config.js b/frontend/eslint.a11y.config.js index baaf241..82266ed 100644 --- a/frontend/eslint.a11y.config.js +++ b/frontend/eslint.a11y.config.js @@ -9,6 +9,17 @@ import svelteConfig from './svelte.config.js'; const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); +// Svelte 5 a11y checking — no separate svelte/a11y-* rules exist in +// eslint-plugin-svelte v3.20.0. All a11y validation is built into the +// Svelte 5 compiler itself (42 checks covering alt-text, ARIA, keyboard +// interaction, semantic HTML, tabindex, roles, labels, etc.). The +// svelte/valid-compile rule below surfaces EVERY compiler warning — including +// all compiler-level a11y diagnostics — as ESLint errors. +// +// See node_modules/svelte/src/compiler/warnings.js for the full list of +// a11y_* warning codes. No separate eslint-plugin-a11y or jsx-a11y rules +// are needed since the Svelte 5 compiler covers them natively. + export default defineConfig( includeIgnoreFile(gitignorePath), js.configs.recommended, @@ -34,10 +45,11 @@ export default defineConfig( 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. + // Surface ALL Svelte 5 compiler warnings as errors — this catches every + // built-in a11y check (a11y_missing_attribute, a11y_click_events_have_key_events, + // a11y_no_static_element_interactions, a11y_role_has_required_aria_props, + // a11y_label_has_associated_control, a11y_media_has_caption, … 42 total). + // No warning filter is applied, so every diagnostic is reported. 'svelte/valid-compile': 'error', // Require explicit type attribute on