Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 2.89 KB

README.md

File metadata and controls

82 lines (53 loc) · 2.89 KB

HTMLHint

Build Status Coverage Status NPM version NPM count License

HTMLHint is a Static Code Analysis Tool for HTML, you can use it with IDE or in build system.

Getting started

  1. 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
    
  2. 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
    
  3. 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>
         ...
    

Guide

  1. How to use
  2. All Rules
  3. How to Develop

License

The MIT License.

Contributors

This project exists thanks to all these people. Contribute.

Backers

Thank you to all our backers! Become a backer.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.