From 08a4ac9330b338f53b1d763f86e8bb3a90cfdc7f Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 28 Jun 2023 11:39:54 +0200 Subject: [PATCH] fix: relax a11y "no redundant role" rule for li, ul, ol fixes #8854 --- .changeset/pretty-tools-whisper.md | 5 +++ .../src/compiler/compile/nodes/Element.js | 6 +++- .../a11y-no-redundant-roles/input.svelte | 12 +++---- .../a11y-no-redundant-roles/warnings.json | 36 ------------------- 4 files changed, 16 insertions(+), 43 deletions(-) create mode 100644 .changeset/pretty-tools-whisper.md diff --git a/.changeset/pretty-tools-whisper.md b/.changeset/pretty-tools-whisper.md new file mode 100644 index 000000000000..8af633242f44 --- /dev/null +++ b/.changeset/pretty-tools-whisper.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: relax a11y "no redundant role" rule for li, ul, ol diff --git a/packages/svelte/src/compiler/compile/nodes/Element.js b/packages/svelte/src/compiler/compile/nodes/Element.js index 3b18ce0e9416..ecefb0c34e2e 100644 --- a/packages/svelte/src/compiler/compile/nodes/Element.js +++ b/packages/svelte/src/compiler/compile/nodes/Element.js @@ -694,7 +694,11 @@ export default class Element extends Node { ); } // no-redundant-roles - if (current_role === get_implicit_role(this.name, attribute_map)) { + if ( + current_role === get_implicit_role(this.name, attribute_map) && + //