How to turn off JSHint error?

家住魔仙堡 提交于 2019-12-25 04:29:16

问题


I have the following error for my files in tests: Expected an assignment or function call and instead saw an expression. It is generated from Chai libraries asserts. How can I turn it off in my .jshintrc file? I run a Gulp task based on it.


回答1:


Here's how you can silence it inside of a .jshintrc file.

{
  ...
  "expr": true
  ...
}

Source: http://jshint.com/docs/options/#expr




回答2:


You can add the following on top of the line that's generating the error :

/*jshint -W030 */

Reference : http://jslinterrors.com/expected-an-assignment-or-function-call



来源:https://stackoverflow.com/questions/28568707/how-to-turn-off-jshint-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!