Skip to main content

no-deprecated-element

Warns when there is an element defined as deprecated.

This rule reads the deprecated flag of the spec data in @markuplint/html-spec: what a specification marks as deprecated (the features the HTML Living Standard keeps conforming with a warning, SVG, MathML) and what browser vendors deprecate according to @mdn/browser-compat-data.

An element the HTML Living Standard marks as a non-conforming, obsolete feature is no-obsolete-element's concern.

note

The rule covers elements of HTML, SVG and MathML. In the current spec data, the only elements that are deprecated without also being obsolete are the MathML elements <maction> and <mfenced>, so they are what this rule reports today. No HTML or SVG element is reported: the rule exists so that a future spec-data update that adds one is caught automatically, without needing a new rule.

❌ Examples of incorrect code for this rule

<math>
<mfenced></mfenced>
</math>

✅ Examples of correct code for this rule

<math>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
</math>

Interface​

{
"no-deprecated-element": boolean
}

Default Severity​

warning