簡體   English   中英

如何在JSHint中設置選項列表?

[英]How to set the list of options in JSHint?

我想抑制JSHint中的一些警告/錯誤。 在文檔中它表示將其作為參數傳遞,但是我有點困惑。

source = "...."; // JavaScript source content
var success = JSHINT(source, options, globals);

例如,我要同時抑制“ smarttabs”和“ evil”。 我怎么做?

http://www.jshint.com/docs/config/

只要提供這樣的指令注釋,jshint就會適應:

/* jshint undef: true, unused: true */
/* global MY_GLOBAL */

(此外,您可以通過上面的鏈接查看更多配置選項,例如創建JSON文字以配置jshint的行為)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM