Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 下一行的JSHint和JSCS inline ignore_Javascript_Jshint_Jscs - Fatal编程技术网

Javascript 下一行的JSHint和JSCS inline ignore

Javascript 下一行的JSHint和JSCS inline ignore,javascript,jshint,jscs,Javascript,Jshint,Jscs,有没有可能让JSHint和jsc在inline ignore上很好地配合下一行 我想做一些类似的事情: /* jshint camelcase: false, jscs requireCamelCaseOrUpperCaseIdentifiers: false */ 我尝试了几个不同的变体(单独的“注释块”,中间有分号,不同的行表示忽略),但都无法实现。也许我遗漏了一些明显的东西?还是根本不可能?Thnx.JSHint不允许为一行禁用特定规则,但可以为一行禁用所有验证: var do_some

有没有可能让JSHint和jsc在inline ignore上很好地配合下一行

我想做一些类似的事情:

/* jshint camelcase: false, jscs requireCamelCaseOrUpperCaseIdentifiers: false */

我尝试了几个不同的变体(单独的“注释块”,中间有分号,不同的行表示忽略),但都无法实现。也许我遗漏了一些明显的东西?还是根本不可能?Thnx.

JSHint不允许为一行禁用特定规则,但可以为一行禁用所有验证:

var do_something; /* jshint ignore:line */
对于JSC,启用/禁用单个规则的语法如下所示:

// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
...
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
总之,要禁用特定行的JSHint和JSCS验证,可以使用上面注释的组合:

// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
var var_name_with_underscores; /* jshint ignore:line */
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
如果非camelcase标识符在块内的多行中使用(通常是规则),则可能需要将整个函数包含在注释中

// jscs: disable requireCamelCaseOrUpperCaseIdentifiers
/* jshint ignore:start */
function foo()
{
    var var_name_with_underscores;
    ...
    var_name_with_underscores = 123;
    ...
}
/* jshint ignore:end */
// jscs: enable requireCamelCaseOrUpperCaseIdentifiers