Skip to content

no-deprecated-attr

Reports an attribute that HTML5 no longer has on that element (align, bgcolor, border, …).

Presentation in attributes is outdated and browsers may stop honoring it; it also overrides less specific CSS in surprising ways.

To fix, use CSS.

Reported
...
<div align="center">x</div>
...
<img src="a.png" alt="">
...
angular:
lint:
rules:
no-deprecated-attr: warn # off, warn (default), error
html:
lint:
rules:
no-deprecated-attr: warn # off, warn (default), error
svelte:
lint:
rules:
no-deprecated-attr: warn # off, warn (default), error
vue:
lint:
rules:
no-deprecated-attr: warn # off, warn (default), error

Enabled by the presets: html/html-validate-standard, html/html-eslint-recommended.

Suppress one line with sudsy-disable-next-line no-deprecated-attr in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-eslint no-obsolete-attrs full
html-validate no-deprecated-attr full