From 958884b5761a569f0ee44949e30081ee8ffc0783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Mon, 13 Apr 2026 14:34:23 +0200 Subject: [PATCH] Fix template-no-nested-landmark: drop port-only section/region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream excludes
from LANDMARK_ELEMENTS and 'region' from LANDMARK_ROLES. Restore parity — port was over-flagging legitimate nested sections. --- lib/rules/template-no-nested-landmark.js | 3 +-- tests/lib/rules/template-no-nested-landmark.js | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rules/template-no-nested-landmark.js b/lib/rules/template-no-nested-landmark.js index 1bdbdd11b3..9e516d9ccc 100644 --- a/lib/rules/template-no-nested-landmark.js +++ b/lib/rules/template-no-nested-landmark.js @@ -5,11 +5,10 @@ const LANDMARK_ROLES = new Set([ 'form', 'main', 'navigation', - 'region', 'search', ]); -const LANDMARK_ELEMENTS = new Set(['header', 'aside', 'footer', 'form', 'main', 'nav', 'section']); +const LANDMARK_ELEMENTS = new Set(['header', 'aside', 'footer', 'form', 'main', 'nav']); const EQUIVALENT_ROLE = { aside: 'complementary', diff --git a/tests/lib/rules/template-no-nested-landmark.js b/tests/lib/rules/template-no-nested-landmark.js index 03aca0099a..1e8a1945c0 100644 --- a/tests/lib/rules/template-no-nested-landmark.js +++ b/tests/lib/rules/template-no-nested-landmark.js @@ -42,6 +42,11 @@ ruleTester.run('template-no-nested-landmark', rule, { '', '', '', + + // `
` is not a landmark element per upstream, so nested sections are allowed. + '', + // `role="region"` is not a landmark role per upstream, so nested regions are allowed. + '', ], invalid: [