From 846413c14913d3afd6f5d73d261c6ccae65adfb0 Mon Sep 17 00:00:00 2001 From: Rajat Vig Date: Thu, 17 Dec 2015 16:31:15 -0800 Subject: [PATCH] Update eslint-plugin-angular to the latest eslint-plugin-angular in use by the project is quite old and the new library has changed rules. This patch updates the library and fixes the code where rule names have changed. Change-Id: I2e60a07b899325f17f38b96d40325602b4b58219 Closes-Bug: #1527417 --- .eslintrc | 4 ++-- .../framework/util/bind-scope/bind-scope.spec.js | 4 ++-- horizon/static/framework/util/http/http.js | 8 +++++--- .../hz-promise-toggle.directive.js | 2 +- .../button-tooltip.row-warning.service.js | 4 ++-- .../magic-overrides.directive.spec.js | 6 +++--- .../st-magic-search.directive.spec.js | 4 ++-- .../widgets/metadata/tree/tree.service.js | 6 +++--- .../framework/widgets/table/table.controller.js | 4 ++-- .../static/framework/widgets/table/table.spec.js | 4 ++-- .../widgets/wizard/modal-container.controller.js | 4 ++-- .../widgets/wizard/wizard.controller.js | 16 ++++++++-------- .../launch-instance-wizard.controller.js | 6 +++--- .../core/images/table/images-table.controller.js | 4 ++-- .../core/openstack-service-api/heat.service.js | 2 +- .../core/openstack-service-api/policy.service.js | 2 +- .../openstack-service-api/settings.service.js | 7 +++---- package.json | 2 +- 18 files changed, 45 insertions(+), 44 deletions(-) diff --git a/.eslintrc b/.eslintrc index daaed5c31..e69780855 100644 --- a/.eslintrc +++ b/.eslintrc @@ -41,10 +41,10 @@ rules: # Angular Plugin Customization ############################################################################# - angular/ng_controller_as_vm: + angular/controller-as-vm: - 1 - "ctrl" # Remove after migrating to angular 1.4 or later. - angular/ng_no_cookiestore: + angular/no-cookiestore: - 1 diff --git a/horizon/static/framework/util/bind-scope/bind-scope.spec.js b/horizon/static/framework/util/bind-scope/bind-scope.spec.js index fc5d8d58d..a01cc622b 100644 --- a/horizon/static/framework/util/bind-scope/bind-scope.spec.js +++ b/horizon/static/framework/util/bind-scope/bind-scope.spec.js @@ -13,9 +13,9 @@ beforeEach(module('horizon.framework')); beforeEach(module('horizon.framework.util.bind-scope', function ($compileProvider) { - /* eslint-disable angular/ng_module_getter */ + /* eslint-disable angular/module-getter */ $compileProvider.directive('testBindScope', testBindScope); - /* eslint-enable angular/ng_module_getter */ + /* eslint-enable angular/module-getter */ function testBindScope() { var directive = { diff --git a/horizon/static/framework/util/http/http.js b/horizon/static/framework/util/http/http.js index 0962182aa..36258fb92 100644 --- a/horizon/static/framework/util/http/http.js +++ b/horizon/static/framework/util/http/http.js @@ -17,18 +17,20 @@ limitations under the License. (function () { 'use strict'; + /* eslint-disable angular/no-service-method */ angular .module('horizon.framework.util.http', []) .service('horizon.framework.util.http.service', ApiService); + /* eslint-enable angular/no-service-method */ ApiService.$inject = ['$http', '$window']; function ApiService($http, $window) { var httpCall = function (method, url, data, config) { - /* eslint-disable angular/ng_window_service */ + /* eslint-disable angular/window-service */ url = $window.WEBROOT + url; - /* eslint-enable angular/ng_window_service */ + /* eslint-enable angular/window-service */ url = url.replace(/\/+/g, '/'); @@ -46,7 +48,7 @@ limitations under the License. }; this.get = function(url, config) { - return httpCall('GET', url, undefined, config); + return httpCall('GET', url, null, config); }; this.post = function(url, data, config) { diff --git a/horizon/static/framework/util/promise-toggle/hz-promise-toggle.directive.js b/horizon/static/framework/util/promise-toggle/hz-promise-toggle.directive.js index 52b7784ff..69eba0dc5 100644 --- a/horizon/static/framework/util/promise-toggle/hz-promise-toggle.directive.js +++ b/horizon/static/framework/util/promise-toggle/hz-promise-toggle.directive.js @@ -96,7 +96,7 @@ terminal: true, restrict: 'A', compile: compile, - $$tlb: true + $$tlb: true //eslint-disable-line angular/no-private-call }; return directive; diff --git a/horizon/static/framework/widgets/action-list/button-tooltip.row-warning.service.js b/horizon/static/framework/widgets/action-list/button-tooltip.row-warning.service.js index ba6f69b24..02516d697 100644 --- a/horizon/static/framework/widgets/action-list/button-tooltip.row-warning.service.js +++ b/horizon/static/framework/widgets/action-list/button-tooltip.row-warning.service.js @@ -48,10 +48,10 @@ /////////////// function expandDetail() { - /*eslint-disable angular/ng_controller_as_vm */ + /*eslint-disable angular/controller-as-vm */ // 'this' referred here is the this for the function not the controller var row = this.element.closest('tr'); - /*eslint-enable angular/ng_controller_as_vm */ + /*eslint-enable angular/controller-as-vm */ if (!row.hasClass('expanded')) { // Timeout needed to prevent // $apply already in progress error diff --git a/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js b/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js index 762a03b80..9c927df9b 100644 --- a/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js +++ b/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js @@ -79,20 +79,20 @@ } ]; - /* eslint-disable angular/ng_window_service */ + /* eslint-disable angular/window-service */ var markup = '' + ''; - /* eslint-enable angular/ng_window_service */ + /* eslint-enable angular/window-service */ $compile(angular.element(markup))($scope); $scope.$apply(); - $magicScope = $scope.$$childTail; //eslint-disable-line angular/ng_no_private_call + $magicScope = $scope.$$childTail; //eslint-disable-line angular/no-private-call spyOn($magicScope, '$emit'); spyOn($magicScope, 'emitQuery'); diff --git a/horizon/static/framework/widgets/magic-search/st-magic-search.directive.spec.js b/horizon/static/framework/widgets/magic-search/st-magic-search.directive.spec.js index caee1464f..67b428f07 100644 --- a/horizon/static/framework/widgets/magic-search/st-magic-search.directive.spec.js +++ b/horizon/static/framework/widgets/magic-search/st-magic-search.directive.spec.js @@ -89,9 +89,9 @@ } ]; - /* eslint-disable angular/ng_window_service */ + /* eslint-disable angular/window-service */ var msTemplate = window.STATIC_URL + 'framework/widgets/magic-search/magic-search.html'; - /* eslint-enable angular/ng_window_service */ + /* eslint-enable angular/window-service */ var stMagicSearch = '' + '