bump to 0.1.3
edp htmlhint [target]
使用htmlhint对当前目录下所有HTML文件代码进行检测。检测结果将输出markdown格式的报告。
htmlhint
当前目录
如果当前目录或子目录下包含.htmlhintrc文件,则检测过程使用该用户配置,否则使用edp默认配置。
子目录
.htmlhintrc
针对标签的配置:
[ { element: "a", attributes: { "charset": true, "coords": true, "download": true, "href": true, "hreflang": true, "media": true, "name": true, "ping": true, "rel": true, "rev": true, "shape": true, "target": true, "type": true } }, { element: "abbr", attributes: { } } ]
扩展规则配置:
[ { on: "div:not([class])", test: function(index, element, lint) { lint.warn("CLASSLESS_DIV"); } }, { on: "*", test: function(index, element, lint) { var cls = this.className; if(this.hasAttribute('class') && /^\s*$/.test(cls)) { lint.warn("EMPTY_CLASS"); } } } ]
更多配置暂时可参考:
https://github.com/ecomfe/edp-htmlhint/blob/master/lib/elements.js
https://github.com/ecomfe/edp-htmlhint/blob/master/lib/config.js
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
edp-htmlhint
Usage
Description
使用
htmlhint对当前目录下所有HTML文件代码进行检测。检测结果将输出markdown格式的报告。如果
当前目录或子目录下包含.htmlhintrc文件,则检测过程使用该用户配置,否则使用edp默认配置。针对标签的配置:
扩展规则配置:
更多配置暂时可参考:
https://github.com/ecomfe/edp-htmlhint/blob/master/lib/elements.js
https://github.com/ecomfe/edp-htmlhint/blob/master/lib/config.js