【发布时间】:2011-06-06 11:55:28
【问题描述】:
JSLint 站点已更新,我无法再检查 JS 脚本。对我来说,这个警告并不重要,我不想通过数千行来解决这个问题,我想找到更关键的问题。
有人知道如何关闭此错误,或使用旧版 JSLint 吗?
更新
例子:
function doSomethingWithNodes(nodes){
this.doSomething();
for (var i = 0; i < nodes.length; ++i){
this.doSomethingElse(nodes[i]);
}
doSomething(); // want to find this problem
}
jslint.com 输出:
Error:
Problem at line 4 character 8: Move all 'var' declarations to the top of the function.
for (var i = 0; i < nodes.length; ++i){
Problem at line 4 character 8: Stopping, unable to continue. (44% scanned).
问题:
在函数之上具有变量是新要求。我无法使用 JSLINT 来测试代码,因为它会在出现此错误时停止扫描脚本。
我有很多代码,不想将此警告威胁为严重错误。
2011 年 8 月 22 日更新:找到 http://jshint.com,它看起来比 http://jslint.com/ 好很多
【问题讨论】:
-
你能澄清你的问题吗?你实际上是在问两个问题吗?
-
如果您取消勾选
Stop on first error,它是否仍然会在第一个错误时停止? -
这个网站会做得更好 -> glat.info/jscheck
-
@Lee Kowalkowski - 只需将您的代码复制到那里并运行它。我在顶部声明变量,所以它会忽略它们。 (如Window、$等)
-
JSHint 是个不错的选择。
标签: javascript jslint