JSLint:控制注释(选择性忽略) [英] JSLint: control comments (selective ignore)

查看:149
本文介绍了JSLint:控制注释(选择性忽略)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JSLint 是否有类似JavaScript Lint的控制评论(例如 / * jsl:fallthru * / )以使其忽略某些段落?

Does JSLint have anything like JavaScript Lint's control comments (e.g. /*jsl:fallthru*/) to make it ignore certain passages?

推荐答案

Put

/*ignore jslint start*/

之前和

/*ignore jslint end*/ 

代码后被忽略了。例如:

after the code to be ignored. Ex:

function ignore(){
    /*ignore jslint start*/
    var x; var y;
    /*ignore jslint end*/
}

或导出JsLint设置,定义你的IgnoreErrorStart / IgnoreErrorEnd符号并导入。

Or export JsLint settings, define your IgnoreErrorStart/ IgnoreErrorEnd symbols and import.



编辑

有些人可能会混淆这个答案与JSHint。在这种情况下,使用这些:


Edit
Some folks may confuse this answer with JSHint. In that case, use these:

/*jshint ignore:start*/
  <!-- code in here -->
/*jshint ignore:end*/

取自https://stackoverflow.com/a/26012357/313501

这篇关于JSLint:控制注释(选择性忽略)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆