Skip to content

no-conditional-comment

Reports an Internet Explorer conditional comment (<!--[if IE]>).

Only Internet Explorer 9 and older read the content; every other browser sees a comment, so it is code that no current browser runs.

To fix, remove the comment, or replace it with feature detection or CSS.

Reported
<!DOCTYPE html>
<title>x</title>
<!--[if IE]><p>old</p><![endif]-->
<!-- fine -->
angular:
lint:
rules:
no-conditional-comment: warn # off (default), warn, error
html:
lint:
rules:
no-conditional-comment: warn # off (default), warn, error
svelte:
lint:
rules:
no-conditional-comment: warn # off (default), warn, error
vue:
lint:
rules:
no-conditional-comment: warn # off (default), warn, error

Enabled by the presets: html/html-validate-recommended.

Suppress one line with sudsy-disable-next-line no-conditional-comment 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-validate no-conditional-comment full