Skip to content

y8n/xg-htmlhint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xg-htmlhint

xg-htmlhint 是一个静态的HTML代码检查工具,可以在命令行和页面脚本中使用。Fork自https://github.com/yaniswang/HTMLHint,在其基础上做了部分改进和扩展。

Quick Start

  1. install & options

    npm install htmlhint -g
    xhtmlhint -V
    xhtmlhint -l
    xhtmlhint -c rule.conf
    
  2. hint

    xhtmlhint test.html
    xhtmlhint test/
    xhtmlhint 
    
  3. result

    test.html:
    	line 1, col 1: Doctype must be uppercase.
    	line 11, col 21: The value of attribute [ class ] must be in double quotes.
    	line 14, col 2: Special characters must be escaped : [ < ].
    	line 14, col 49: Special characters must be escaped : [ > ].
    	line 14, col 78: Tag must be paired, no start tag: [ <button> ]
    
    4 Errors,1 Warnings
    
  4. config rules
    根目录下获取.htmlhintrc文件中的内容作为自定义配置规则,如果没有就使用默认规则。也可以指定配置文件,使用命令htmlhint -c rule.conf
    行内嵌套规则

    <!--htmlhint tag-pair:false,id-class-value:underline -->
    <html>
    <head>
    

Guide

  1. 如何使用
  2. 规则列表
  3. 如何添加自定义规则

About

A Static Code Analysis Tool for HTML,Fork from https://github.com/yaniswang/HTMLHint.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published