From 9697a9f580476f7b4780e07b600c6643507fffdc Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 19 Feb 2016 10:41:34 +0100 Subject: [PATCH] bump eslint version to 1.10.3 bumps the eslint version to 1.10.3 which fixes a lot of issues, especially rules not working as expected or being ignored and brings the js code up to date to comply with those rules. Change-Id: I1234e7991f98d4ceb0c5333dc036c6a30206ff64 --- .eslintignore | 2 +- horizon/static/auth/login/login.spec.js | 6 +- horizon/static/framework/util/i18n/i18n.js | 4 +- .../hz-promise-toggle.directive.js | 6 +- .../load-edit/load-edit.directive.spec.js | 8 +-- .../hz-magic-search-bar.directive.js | 6 +- .../widgets/table/hz-select-all.directive.js | 4 +- horizon/static/horizon/js/horizon.quota.js | 4 +- .../keypair/keypair.controller.spec.js | 12 ++-- .../launch-instance-model.service.spec.js | 64 +++++++++---------- .../openstack-service-api/glance.service.js | 4 +- package.json | 2 +- 12 files changed, 61 insertions(+), 61 deletions(-) diff --git a/.eslintignore b/.eslintignore index 6a9459de37..23fe2e3da0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1 @@ -horizon/static/horizon/lib/ \ No newline at end of file +horizon/static/horizon/lib/** \ No newline at end of file diff --git a/horizon/static/auth/login/login.spec.js b/horizon/static/auth/login/login.spec.js index 16d77794a8..b3ee471879 100644 --- a/horizon/static/auth/login/login.spec.js +++ b/horizon/static/auth/login/login.spec.js @@ -43,9 +43,9 @@ var pass = actual.css('display') !== 'none'; var result = { pass: pass, - message: pass ? - 'Expected element to be visible' : - 'Expected element to be visible, but it is hidden' + message: pass + ? 'Expected element to be visible' + : 'Expected element to be visible, but it is hidden' }; return result; } diff --git a/horizon/static/framework/util/i18n/i18n.js b/horizon/static/framework/util/i18n/i18n.js index c49e368e18..cadaab0c43 100644 --- a/horizon/static/framework/util/i18n/i18n.js +++ b/horizon/static/framework/util/i18n/i18n.js @@ -43,8 +43,8 @@ function getText($window) { // If no global function, revert to just returning given text. var gettextFunc = $window.gettext || function (x) { - return x; - }; + return x; + }; // Eventually, could delete the window gettext references here, // or provide an appropriate method. 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 69eba0dc59..9cd483dbe2 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 @@ -114,9 +114,9 @@ function resolvePromises(scope, iterStartElement) { var resolvedInput = input(scope); - var promiseResolver = angular.isArray(resolvedInput) ? - multiPromiseResolver(singlePromiseResolver, resolvedInput) : - singlePromiseResolver(resolvedInput); + var promiseResolver = angular.isArray(resolvedInput) + ? multiPromiseResolver(singlePromiseResolver, resolvedInput) + : singlePromiseResolver(resolvedInput); promiseResolver.then(linkContent, removeContent); diff --git a/horizon/static/framework/widgets/load-edit/load-edit.directive.spec.js b/horizon/static/framework/widgets/load-edit/load-edit.directive.spec.js index 387fe45e28..a602026947 100644 --- a/horizon/static/framework/widgets/load-edit/load-edit.directive.spec.js +++ b/horizon/static/framework/widgets/load-edit/load-edit.directive.spec.js @@ -28,10 +28,10 @@ readFileService = {}; $provide.provider('horizon.framework.util.file.file-reader', function () { - this.$get = function () { - return readFileService; - }; - }); + this.$get = function () { + return readFileService; + }; + }); })); beforeEach(inject(function ($injector) { $scope = $injector.get('$rootScope').$new(); diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js index ae43a069ae..bfdd888343 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js @@ -108,9 +108,9 @@ cancel: gettext('Cancel'), prompt: gettext('Click here for filters.'), remove: gettext('Remove'), - text: (scope.clientFullTextSearch ? - gettext('Search in current results') : - gettext('Full Text Search')) + text: (scope.clientFullTextSearch + ? gettext('Search in current results') + : gettext('Full Text Search')) }; scope.filterStrings = scope.filterStrings || defaultFilterStrings; diff --git a/horizon/static/framework/widgets/table/hz-select-all.directive.js b/horizon/static/framework/widgets/table/hz-select-all.directive.js index fdd739c76b..69cd1b4dd4 100644 --- a/horizon/static/framework/widgets/table/hz-select-all.directive.js +++ b/horizon/static/framework/widgets/table/hz-select-all.directive.js @@ -86,8 +86,8 @@ * on sort, filter and pagination */ var unWatchTableState = scope.$watch(function() { - return stTableCtrl.tableState(); - }, + return stTableCtrl.tableState(); + }, updateSelectAll, true ); diff --git a/horizon/static/horizon/js/horizon.quota.js b/horizon/static/horizon/js/horizon.quota.js index 2bd630210c..6b41f9f920 100644 --- a/horizon/static/horizon/js/horizon.quota.js +++ b/horizon/static/horizon/js/horizon.quota.js @@ -100,8 +100,8 @@ horizon.Quota = { */ noteDisabledFlavors: function(allDisabled) { if ($('#some_flavors_disabled').length === 0) { - var message = allDisabled ? horizon.Quota.allFlavorsDisabledMessage : - horizon.Quota.disabledFlavorMessage; + var message = allDisabled ? horizon.Quota.allFlavorsDisabledMessage + : horizon.Quota.disabledFlavorMessage; $('#id_flavor').parent().append("" + message + ''); } diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/keypair/keypair.controller.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/keypair/keypair.controller.spec.js index 006efb3b44..6830581742 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/keypair/keypair.controller.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/keypair/keypair.controller.spec.js @@ -26,12 +26,12 @@ beforeEach(module('horizon.dashboard.project')); beforeEach(function() { - settings = { - OPENSTACK_HYPERVISOR_FEATURES: { - requires_keypair: false - } - }; - }); + settings = { + OPENSTACK_HYPERVISOR_FEATURES: { + requires_keypair: false + } + }; + }); beforeEach(module(function ($provide) { $provide.value('$modal', $modal); diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js index 3df402dcc9..a9e153b9ed 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.spec.js @@ -25,50 +25,50 @@ var novaExtensionsEnabled = false; var novaApi = { createServer: function(finalSpec) { - return { - then: function () { - return finalSpec; - } - }; - }, + return { + then: function () { + return finalSpec; + } + }; + }, getAvailabilityZones: function() { - var zones = [ - { zoneName: 'zone-1', zoneState: { available: true } }, - { zoneName: 'zone-2', zoneState: { available: true } }, - { zoneName: 'invalid-zone-1' }, - { zoneName: 'invalid-zone-2' } - ]; + var zones = [ + { zoneName: 'zone-1', zoneState: { available: true } }, + { zoneName: 'zone-2', zoneState: { available: true } }, + { zoneName: 'invalid-zone-1' }, + { zoneName: 'invalid-zone-2' } + ]; - var deferred = $q.defer(); - deferred.resolve({ data: { items: zones } }); + var deferred = $q.defer(); + deferred.resolve({ data: { items: zones } }); - return deferred.promise; - }, + return deferred.promise; + }, getFlavors: function() { - var flavors = [ 'flavor-1', 'flavor-2' ]; + var flavors = [ 'flavor-1', 'flavor-2' ]; - var deferred = $q.defer(); - deferred.resolve({ data: { items: flavors } }); + var deferred = $q.defer(); + deferred.resolve({ data: { items: flavors } }); - return deferred.promise; - }, + return deferred.promise; + }, getKeypairs: function() { - var keypairs = [ { keypair: { name: 'key-1' } }, - { keypair: { name: 'key-2' } } ]; + var keypairs = [ { keypair: { name: 'key-1' } }, + { keypair: { name: 'key-2' } } ]; - var deferred = $q.defer(); - deferred.resolve({ data: { items: keypairs } }); + var deferred = $q.defer(); + deferred.resolve({ data: { items: keypairs } }); - return deferred.promise; - }, + return deferred.promise; + }, getLimits: function() { - var limits = { maxTotalInstances: 10, totalInstancesUsed: 0 }; + var limits = { maxTotalInstances: 10, totalInstancesUsed: 0 }; - var deferred = $q.defer(); - deferred.resolve({ data: limits }); + var deferred = $q.defer(); + deferred.resolve({ data: limits }); - return deferred.promise; - } + return deferred.promise; + } }; beforeEach(module('horizon.dashboard.project.workflow.launch-instance')); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js b/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js index 1c138900bc..10c7574164 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js @@ -358,8 +358,8 @@ var promise = apiService.get('/api/glance/metadefs/namespaces/', config); return suppressError ? promise : promise.error(function() { - toastService.add('error', gettext('Unable to retrieve the namespaces.')); - }); + toastService.add('error', gettext('Unable to retrieve the namespaces.')); + }); } /** diff --git a/package.json b/package.json index ae015bdd26..95f7fd0d51 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "repository": "none", "license": "Apache 2.0", "devDependencies": { - "eslint": "1.2.1", + "eslint": "1.10.3", "eslint-config-openstack": "1.2.3", "eslint-plugin-angular": "0.15.0", "jasmine-core": "2.2.0",