Skip to main content

no-empty-palpable-content

Warn if there is an empty palpable content element.

Palpable content makes an element non-empty by providing either some descendant non-empty text, or else something users can hear (audio elements) or view (video, img, or canvas elements) or otherwise interact with (for example, interactive form controls).

Cite: HTML Living Standard 3.2.5.2.8 Palpable content

❌ Examples of incorrect code

<div></div>
<div> </div>
<div>

</div>

✅ Examples of correct code

<div>text contet</div>
<div><img src="path/to" alt="image content" /></div>

Interface

{
"no-empty-palpable-content": boolean
}

Options

{
"no-empty-palpable-content": {
"options": {
"extendsExposableElements"?: boolean
"ignoreIfAriaBusy"?: boolean
}
}
}
PropertyTypeDefault ValueDescription
extendsExposableElementsboolean"true"Include elements that are not palpable content, but are exposed to the accessibility tree. The palpable content model doesn't include some elements that are li, dt, dd, th, td, and more. This option exists to that detect those elements that are empty.
ignoreIfAriaBusyboolean"true"Avoid evaluating it if the element has aria-busy=true.

Default Severity

warning