I got warning in jshint
'[L76:C24] Missing space after 'function''
I follows Nicholas Zakkas Maintainable javascript styles where there is no space after anonymous function. How to remove this warning in 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
}
Normally you have error notices in the following form in your CLI:
[L426:C63] W030: Expected an assignment or function call and instead saw an expression.
Now you can take that WXXX
ID and add it to your options
subobject. Simply add
"-WXXX" : true
for whatever notice you want to turn off. Keep in mind that you only can turn off all notices of a type and no specific notices on specific lines or lines in only single files. Still, you can add different tasks for different files and ignore different hints/notices that way.
Here's an example for grunt-contrib-jshint
. Note: site.scripts
comes from a YAML file that holds the config.
jshint : {
dev : {
options : {
// Ignore: "Bad" line break
"-W014" : true
},
src: [ "<%= site.scripts %>/**/*.js" ]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With