Improving jshint

- Including JS files under horizon/static/angular/ folder.
- Adding .jshintrc to allow globals defined by jQuery, Angular,
  Angular mock, Jasmine, d3 and jsi18n.
- Allowing global strict mode in spec files.

Change-Id: I07359a4b3044cd5f675eef3b7df99398df909f81
Closes-Bug: #1419625
This commit is contained in:
Shaoquan Chen 2015-02-08 12:59:10 -08:00
parent 8bf6bfb957
commit 46b6a3b047
5 changed files with 38 additions and 1 deletions

33
.jshintrc Normal file
View File

@ -0,0 +1,33 @@
{
"browser": true,
"trailing": true,
"evil": true,
"globals": {
"jQuery": false,
"$": false,
"angular": false,
"module": false,
"inject": false,
"describe": false,
"beforeEach": false,
"afterEach": false,
"beforeAll": false,
"afterAll": false,
"it": false,
"expect": false,
"d3": false,
"pluralidx": false,
"gettext": false,
"ngettext": false,
"gettext_noop": false,
"pgettext": false,
"npgettext": false,
"interpolate": false,
"get_format": false
}
}

View File

@ -1,3 +1,4 @@
/* jshint globalstrict: true */
'use strict'; 'use strict';
describe('hz.widget.help-panel module', function() { describe('hz.widget.help-panel module', function() {

View File

@ -1,3 +1,4 @@
/* jshint globalstrict: true */
'use strict'; 'use strict';
describe('hz.widget.modal module', function(){ describe('hz.widget.modal module', function(){

View File

@ -1,3 +1,4 @@
/* jshint globalstrict: true */
'use strict'; 'use strict';
describe('hz.widget.wizard module', function () { describe('hz.widget.wizard module', function () {

View File

@ -157,6 +157,7 @@ function run_jshint {
echo "Running jshint ..." echo "Running jshint ..."
jshint horizon/static/horizon/js jshint horizon/static/horizon/js
jshint horizon/static/horizon/tests jshint horizon/static/horizon/tests
jshint horizon/static/angular/
} }
function warn_on_flake8_without_venv { function warn_on_flake8_without_venv {