14
现在我有以下代码:如何告诉JSLint的不索要{在单行if语句
if (c > last) break;
而且JSLint的抱怨与
jslint:crud.js:69:19:Expected '{' and instead saw 'break'.
有几种方法来克服它:
if (c > last) { break; }
或
if (c > last) {
break;
}
但我希望jslint在if语句位于同一行时不要抱怨。
有没有办法配置它?
BTW:我与崇高文字和崇高-的JSLint插件工作,具有以下配置:
{
// Path to the jslint jar.
// Leave blank to use bundled jar.
"jslint_jar": "",
// Options pass to jslint.
"jslint_options": "--indent 2 --white --maxerr 10000 --nomen --browser --plusplus --es5",
// Ignore errors, regex.
"ignore_errors":
[
"Combine this with the previous 'var' statement.",
"It is not necessary to initialize"
],
// run jslint on save.
"run_on_save": false,
// debug flag.
"debug": false
}
不知道如何配置呢?
非常感谢,我会试一试......你知道它是否适用于jslint4java?在工作中,我不知道我是否可以安装节点 – opensas
@opensas - 恐怕它不会...... jslint4java只是JSLint的Java包装器。 JSHint起初是JSLint的直接分支,但它们现在有很大的不同,有人需要为它编写一个单独的Java包装器。 –
忽略单行if语句使用'curly:false' – dev