是否可以在 Windows 上从 WSH 运行 CSSLint?

发布于 2024-12-10 15:41:28 字数 229 浏览 1 评论 0原文

github 上有一个 CSSLint 项目。它似乎受到 JSLINT/JSHINT 项目的哲学启发。它是一个 JavaScript 程序,用于检查 CSS 文件的语法并抛出错误或警告。

有针对 Rhino 和 Node 的版本。 如何从 Windows Script Host 运行它?

There's a CSSLint project on github. It appears to be philosophically inspired by the JSLINT/JSHINT project. It's a JavaScript program that checks the syntax of CSS files, and throws errors or warnings.

There are versions for Rhino and Node.
How can I run it from Windows Script Host?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

王权女流氓 2024-12-17 15:41:28

获取为与 WSH 配合使用而修改的 csslint 版本

它的工作原理如下:

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;

Get the version of csslint that is modified for use with WSH.

It works like this:

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;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文