考慮到我從yeoman構建的.jshintrc中得到的是,您需要將這些名稱添加到該文件中。
令人討厭的是,除非你用腳手架搭配like,well,yeoman!
這裏是yeoman爲我們創建的.jshintrc - 加上lodash /下劃線和jQuery。
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"multistr": true,
"globals": {
"after": false,
"afterEach": false,
"angular": false,
"before": false,
"beforeEach": false,
"browser": false,
"describe": false,
"expect": false,
"inject": false,
"it": false,
"jasmine": false,
"spyOn": false,
"$": false,
"_": false
}
}
這是在這裏正確回答http://stackoverflow.com/a/27136840/1264548 – edamon 2015-04-10 18:24:35