Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/rules/template-no-nested-landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions tests/lib/rules/template-no-nested-landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ ruleTester.run('template-no-nested-landmark', rule, {
'<template><div role="banner"><nav></nav></div></template>',
'<template><header><div role="navigation"></div></header></template>',
'<template><div role="banner"><div role="navigation"></div></div></template>',

// `<section>` is not a landmark element per upstream, so nested sections are allowed.
'<template><section><section>Content</section></section></template>',
// `role="region"` is not a landmark role per upstream, so nested regions are allowed.
'<template><div role="region"><div role="region">Content</div></div></template>',
],

invalid: [
Expand Down
Loading