简体   繁体   English

为Vim配置JSHint

[英]Configuring JSHint for Vim

I recently installed JSHint to help me out debugging some Javascript code. 我最近安装了JSHint来帮助我调试一些Javascript代码。 JSHint seems to be working flawlessly but now I want to tweak it to suit me better. JSHint似乎完美无缺,但现在我想调整它以更好地适应我。

For exampled. 例如。 I want to disable warning "WXXX", error "EXXX" or add some settings. 我想禁用警告“WXXX”,错误“EXXX”或添加一些设置。 How would I do this using a global .jshintrc file? 我如何使用全局.jshintrc文件执行此操作?

Currently I have ~/.jshintrc that looks something like this: 目前我的〜/ .jshintrc看起来像这样:

{
   //Settings
   "debug": true',
   "devel": true',
   //And some more settings

   "-WXXX": false,
   "-WXXX": false,
   "-EXXX": false
}

But as far as I can tell this is doing nothing. 但据我所知,这无能为力。

To disable a warning, you have to use "-WXXX": true . 要禁用警告,您必须使用"-WXXX": true

You can't disable errors ( EXXX ): http://jshint.com/docs/ 您无法禁用错误( EXXX ): httpEXXX

This syntax works only with warnings (code starts with W ), it doesn't work with errors (code starts with E ). 此语法仅适用于警告(代码以W开头),它不适用于错误(代码以E开头)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM