admin管理员组文章数量:1415111
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'
}),
本文标签: javascriptHow can I suppress a JSLint warning for a single lineStack Overflow
版权声明:本文标题:javascript - How can I suppress a JSLint warning for a single line? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745200306a2647337.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论