有一个CSSLint project on github。它似乎在哲学上受到JSLINT / JSHINT项目的启发。这是一个JavaScript程序,用于检查CSS文件的语法,并引发错误或警告。
有Rhino和Node的版本。
如何从Windows Script Host运行它?
最佳答案
获取the version of csslint that is modified for use with WSH。
它的工作方式如下:
C:\dev\html>cscript c:\bin\csslint-wsh.js --format=compiler style\basic.css
CSSLINT
style\basic.css(5,1) CSSLINT: warning: Heading (h1) has already been defined.
h1 { font-size: 20pt }
style\basic.css(6,1) CSSLINT: warning: Heading (h2) has already been defined.
h2 { font-size: 18pt; font-weight:bold; color: navy }
style\basic.css(7,1) CSSLINT: warning: Heading (h3) has already been defined.
h3 { font-size: 16pt; font-weight:bold; color: #483d8b;}
style\basic.css(8,1) CSSLINT: warning: Heading (h4) has already been defined.
h4 { font-size: 14pt; font-weight:bold; color:#C71585; margin-bottom:2px; }
style\basic.css(9,1) CSSLINT: warning: Heading (h5) has already been defined.
h5 { font-size: 12pt; font-weight:bold; color:#6495ED; margin-bottom:2px; }
style\basic.css(10,1) CSSLINT: warning: Heading (h6) has already been defined.
h6 { font-size: 10pt; font-weight:bold; color:navy }
style\basic.css(12,1) CSSLINT: warning: Element (td.head) is overqualified, just use .head without element name.
td.head { font-size: 12pt; color: #c71585; font-weight: bold; }
style\basic.css(39,4) CSSLINT: warning: Broken box model: using width with padding.
width: 48%;
style\basic.css(44,4) CSSLINT: warning: Broken box model: using width with border.
margin: 0.2em 0 0.2em 0;
关于css - 是否可以在Windows上从WSH运行CSSLint?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7831474/