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
11 changes: 1 addition & 10 deletions lib/rules/template-no-aria-unsupported-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@ module.exports = {

create(context) {
// Elements that don't support ARIA
const ELEMENTS_WITHOUT_ARIA_SUPPORT = new Set([
'meta',
'html',
'script',
'style',
'title',
'base',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these support aria? if not, they should be re-added to this list

'head',
'link',
]);
const ELEMENTS_WITHOUT_ARIA_SUPPORT = new Set(['meta', 'html', 'script', 'style']);

return {
GlimmerElementNode(node) {
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/rules/template-no-aria-unsupported-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ ruleTester.run('template-no-aria-unsupported-elements', rule, {
'<template><div role="button" aria-label="Submit"></div></template>',
'<template><button aria-pressed="true">Toggle</button></template>',
'<template><input aria-label="Username"></template>',
// These elements are not in the unsupported set (only html, meta, script, style are)
'<template><title aria-label="Page Title"></title></template>',
'<template><head role="banner"></head></template>',
'<template><base aria-hidden="true"></template>',
'<template><link aria-label="Stylesheet"></template>',
],

invalid: [
Expand All @@ -29,5 +34,10 @@ ruleTester.run('template-no-aria-unsupported-elements', rule, {
output: null,
errors: [{ messageId: 'unsupported' }],
},
{
code: '<template><html role="application"></html></template>',
output: null,
errors: [{ messageId: 'unsupported' }],
},
],
});
Loading