From 093c02d0b941c327269e92b0e4a41ba1ee7b4635 Mon Sep 17 00:00:00 2001 From: Austin Clark Date: Tue, 26 Jan 2016 11:54:17 -0700 Subject: [PATCH] Fix lint errors and update eslint Fixes a couple of lint errors caught by `npm run lint` in timeline- overview.js and timeline-viewport.js. Also restructures the test- details controller to use appropriate `this.` syntax instead of `$scope.` In addition, eslint and eslint-config-openstack have been updated, and a new .eslintrc.json config file has been created to tweak some specific rules for stackviz. Change-Id: I9e1fe5121621730eb3efda4b99e9fe182f399aee --- .eslintrc | 14 --------- .eslintrc.json | 25 ++++++++++++++++ app/index.html | 2 +- app/js/controllers/home.js | 2 +- app/js/controllers/main.js | 2 +- app/js/controllers/test-details.js | 37 ++++++++++++------------ app/js/controllers/timeline.js | 2 +- app/js/directives/test-details-search.js | 7 ++--- app/js/directives/timeline-overview.js | 1 - app/js/directives/timeline-viewport.js | 8 ++--- app/js/directives/timeline.js | 6 ++-- app/js/main.js | 2 +- app/js/on_config.js | 8 +++-- app/js/on_run.js | 1 + app/js/services/dataset.js | 3 +- app/js/util/array-util.js | 4 +-- app/js/util/dstat-parse.js | 5 ++-- app/views/test-details.html | 18 ++++++------ package.json | 4 +-- test/karma.conf.js | 2 +- test/unit/controllers/test-home.js | 22 -------------- 21 files changed, 82 insertions(+), 93 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.json delete mode 100644 test/unit/controllers/test-home.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0aec8de..0000000 --- a/.eslintrc +++ /dev/null @@ -1,14 +0,0 @@ -# Use eslint-config-openstack -extends: openstack - -# Set up globals -globals: - angular: false - module: false - -env: - browser: true - jasmine: true - -rules: - module-setter: 0 diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..d921449 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends" : "openstack", + + "globals" : { + "angular": false, + "module": false + }, + + "env" : { + "browser": true, + "jasmine": true + }, + + "rules" : { + "module-setter": 0, + "strict": [2,"global"], + "valid-jsdoc": 0, + "brace-style": [2, "1tbs", { "allowSingleLine": true }], + "no-extra-parens": [2, "functions"], + "complexity": 0, + "no-unused-vars": 0, + "guard-for-in": 0 + } + +} diff --git a/app/index.html b/app/index.html index 4b13fe7..532052f 100644 --- a/app/index.html +++ b/app/index.html @@ -10,7 +10,7 @@ - +