我在我的项目中使用RequireJS AMD.当我在我的项目上运行jshint时,它会抛出错误
在AMD Scripts中
'define' is not defined.
Run Code Online (Sandbox Code Playgroud)
在摩卡测试案例中
'describe' is not defined.
'it' is not defined.
Run Code Online (Sandbox Code Playgroud)
如何在jshint中删除此警告?
在.jshintrc中拥有它们的区别和目的是什么?当我想添加一个要忽略的变量时,哪一个是我应该使用的最好的?另外我在http://www.jshint.com/docs/options/找不到'predef'
注意:这是WebStorm问题,而不是angular.js问题.
该问题的截屏视频:http://f.cl.ly/items/302s0d1k1i3i1B2p0W09/ws703-angular-not-defined.mp4
描述:
我在index.html文件中有以下内容:
<script src="vendor/js/angular.min.js"></script>
<script src="app/js/scratch.js"></script>
Run Code Online (Sandbox Code Playgroud)
在scratch.js中,当我引用"angular"时,我不断从JSHint获得这个"angular is not defined"消息.我如何使它如此角度看起来像在这个文件中定义,所以JSHint停止抱怨它?这是配置问题吗?请指教.
WebStorm v7.0.3/Mac OSX v10.9.1