Home > Software design >  VSCode - HTMLHint extension has been deprecated! Where is alternatives?
VSCode - HTMLHint extension has been deprecated! Where is alternatives?

Time:09-06

As you may know VSCode's extension HTMLHint has been deprecated. It was a great static analyzer for html files. None of the alternative extensions work correctly (htmllint, LintHTML, W3C Validation...).

Maybe you can suggest better alternatives?

CodePudding user response:

I found a solution. You need to install HTML-validate. By default is doesn't works, additionally you need to install:

npm install --global html-validate

and restart your VSCode.

If for you (as for me) is very annoying all validation rules, then you should create file .htmlvalidate.json into project root and fill it like this:

{ "elements": [ "html5" ], "extends": [ "html-validate:recommended" ], "rules": { "attr-delimiter": "off", "attr-spacing": "off", "doctype-html": "off", "meta-refresh": "off", "no-conditional-comment": "off", "no-deprecated-attr": "off", "no-redundant-for": "off", "no-redundant-role": "off", "no-style-tag": "off", "prefer-button": "warn", "prefer-tbody": "off", "tel-non-breaking": "off", "unrecognized-char-ref": "off", "attribute-allowed-values": "warn", "no-trailing-whitespace": "off", "no-inline-style": "off", "doctype-style": "off", "class-pattern": "off", "attribute-empty-style": "off", "attribute-boolean-style": "off", "attr-pattern": "off", "input-missing-label": "off", "no-autoplay": "off", "element-permitted-content": "off" } }

All rules are here: HTML-rules

  • Related