HTMLHint is a Static Code Analysis Tool for HTML, you can use it with IDE or in build system.
-
Installation & hints
npm install htmlhint -g htmlhint -V htmlhint --help htmlhint www htmlhint www/test.html htmlhint www/**/*.xhtml htmlhint www/**/*.{htm,html} htmlhint http://www.alibaba.com/ cat test.html | htmlhint stdin
-
Results
test.html L5 | </head> ^ <title> must be present in <head> tag. (title-require) L8 | </body> ^ Tag must be paired, missing: [ </div> ], start tag match failed [ <div> ] on line 7. (tag-pair) 2 errors in 1 files
-
Config rules
search
.htmlhintrc
file in current directory and all parent directories:htmlhint htmlhint test.html
custom config file:
htmlhint --config htmlhint.conf test.html
custom rules:
htmlhint --rules tag-pair,id-class-value=underline test.html
Inline rules in
test.html
:<!--htmlhint tag-pair,id-class-value:underline --> <html> <head> ...
This project exists thanks to all these people. Contribute.
Thank you to all our backers! Become a backer.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.