I use nicEdit editor, which has a function object called nicEditor
.
JSLint puts a warning on it:
A constructor name 'nicEditor' should start with an uppercase letter.
It ignores the /*jslint newcap:false */
option I put right before the troubled line"
/*jslint newcap:false */
var nic_editor = new nicEditor({
buttonList : ['bold', 'italic', 'underline', 'strikethrough', 'emoticonToolbar'],
iconsPath : '/assets/nicEditorIcons.gif'
}),
/*jslint newcap:true */
How can I suppress this warning but only for this line?
I use nicEdit editor, which has a function object called nicEditor
.
JSLint puts a warning on it:
A constructor name 'nicEditor' should start with an uppercase letter.
It ignores the /*jslint newcap:false */
option I put right before the troubled line"
/*jslint newcap:false */
var nic_editor = new nicEditor({
buttonList : ['bold', 'italic', 'underline', 'strikethrough', 'emoticonToolbar'],
iconsPath : '/assets/nicEditorIcons.gif'
}),
/*jslint newcap:true */
How can I suppress this warning but only for this line?
Share Improve this question edited Mar 4, 2013 at 16:40 James Allardice 166k22 gold badges334 silver badges315 bronze badges asked Mar 4, 2013 at 16:22 zubazuba 1,5081 gold badge19 silver badges50 bronze badges 2- Can you switch to JSHint instead? This kind of thing is much easier with that. – James Allardice Commented Mar 4, 2013 at 16:42
- I don't think I can switch easily 'cause I use JSLint through hallettj/jslint.vim Vim plugin. – zuba Commented Mar 4, 2013 at 17:31
1 Answer
Reset to default 6I don't believe its possible to be more finegrained than you currently are. And TBH, I think your current solution is just fine.
If you really want to avoid the newCaps
setting you could just use a local variable to rename the constructor:
var NicEditor = nicEditor;
var nic_editor = new NicEditor({
buttonList : ['bold', 'italic', 'underline', 'strikethrough', 'emoticonToolbar'],
iconsPath : '/assets/nicEditorIcons.gif'
}),
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745200306a4616290.html
评论列表(0条)