[英]How to disable the warning 'define' is not defined using JSHint and RequireJS
[英]JSHINT: how to disable the warning Missing space after anonymous 'function'
我在jshint收到警告
'[L76:C24] Missing space after 'function''
我遵循Nicholas Zakkas可 維護的javascript樣式,匿名函數后沒有空格。 如何在jshint中刪除此警告?
.jshintrc
{
"node": true,
"browser": true,
"es5": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true
}
通常,您在CLI中有以下表單中的錯誤通知:
[L426:C63] W030:預期賦值或函數調用,而是看到一個表達式。
現在,您可以將該WXXX
ID添加到options
子對象中。 只需添加
"-WXXX" : true
無論你想要什么通知關閉。 請記住,您只能關閉某個類型的所有通知,而不能僅關注單個文件中特定行或行的特定通知。 不過,您可以為不同的文件添加不同的任務,並忽略不同的提示/通知。
這是grunt-contrib-jshint
的一個例子。 注意: site.scripts
來自保存配置的YAML文件。
jshint : {
dev : {
options : {
// Ignore: "Bad" line break
"-W014" : true
},
src: [ "<%= site.scripts %>/**/*.js" ]
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.