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
This commit is contained in:
Itxaka 2016-02-19 10:41:34 +01:00 committed by Itxaka Serrano Garcia
parent e1f07e2794
commit 9697a9f580
12 changed files with 61 additions and 61 deletions

View File

@ -1 +1 @@
horizon/static/horizon/lib/ horizon/static/horizon/lib/**

View File

@ -43,9 +43,9 @@
var pass = actual.css('display') !== 'none'; var pass = actual.css('display') !== 'none';
var result = { var result = {
pass: pass, pass: pass,
message: pass ? message: pass
'Expected element to be visible' : ? 'Expected element to be visible'
'Expected element to be visible, but it is hidden' : 'Expected element to be visible, but it is hidden'
}; };
return result; return result;
} }

View File

@ -43,8 +43,8 @@
function getText($window) { function getText($window) {
// If no global function, revert to just returning given text. // If no global function, revert to just returning given text.
var gettextFunc = $window.gettext || function (x) { var gettextFunc = $window.gettext || function (x) {
return x; return x;
}; };
// Eventually, could delete the window gettext references here, // Eventually, could delete the window gettext references here,
// or provide an appropriate method. // or provide an appropriate method.

View File

@ -114,9 +114,9 @@
function resolvePromises(scope, iterStartElement) { function resolvePromises(scope, iterStartElement) {
var resolvedInput = input(scope); var resolvedInput = input(scope);
var promiseResolver = angular.isArray(resolvedInput) ? var promiseResolver = angular.isArray(resolvedInput)
multiPromiseResolver(singlePromiseResolver, resolvedInput) : ? multiPromiseResolver(singlePromiseResolver, resolvedInput)
singlePromiseResolver(resolvedInput); : singlePromiseResolver(resolvedInput);
promiseResolver.then(linkContent, removeContent); promiseResolver.then(linkContent, removeContent);

View File

@ -28,10 +28,10 @@
readFileService = {}; readFileService = {};
$provide.provider('horizon.framework.util.file.file-reader', $provide.provider('horizon.framework.util.file.file-reader',
function () { function () {
this.$get = function () { this.$get = function () {
return readFileService; return readFileService;
}; };
}); });
})); }));
beforeEach(inject(function ($injector) { beforeEach(inject(function ($injector) {
$scope = $injector.get('$rootScope').$new(); $scope = $injector.get('$rootScope').$new();

View File

@ -108,9 +108,9 @@
cancel: gettext('Cancel'), cancel: gettext('Cancel'),
prompt: gettext('Click here for filters.'), prompt: gettext('Click here for filters.'),
remove: gettext('Remove'), remove: gettext('Remove'),
text: (scope.clientFullTextSearch ? text: (scope.clientFullTextSearch
gettext('Search in current results') : ? gettext('Search in current results')
gettext('Full Text Search')) : gettext('Full Text Search'))
}; };
scope.filterStrings = scope.filterStrings || defaultFilterStrings; scope.filterStrings = scope.filterStrings || defaultFilterStrings;

View File

@ -86,8 +86,8 @@
* on sort, filter and pagination * on sort, filter and pagination
*/ */
var unWatchTableState = scope.$watch(function() { var unWatchTableState = scope.$watch(function() {
return stTableCtrl.tableState(); return stTableCtrl.tableState();
}, },
updateSelectAll, updateSelectAll,
true true
); );

View File

@ -100,8 +100,8 @@ horizon.Quota = {
*/ */
noteDisabledFlavors: function(allDisabled) { noteDisabledFlavors: function(allDisabled) {
if ($('#some_flavors_disabled').length === 0) { if ($('#some_flavors_disabled').length === 0) {
var message = allDisabled ? horizon.Quota.allFlavorsDisabledMessage : var message = allDisabled ? horizon.Quota.allFlavorsDisabledMessage
horizon.Quota.disabledFlavorMessage; : horizon.Quota.disabledFlavorMessage;
$('#id_flavor').parent().append("<span id='some_flavors_disabled'>" + $('#id_flavor').parent().append("<span id='some_flavors_disabled'>" +
message + '</span>'); message + '</span>');
} }

View File

@ -26,12 +26,12 @@
beforeEach(module('horizon.dashboard.project')); beforeEach(module('horizon.dashboard.project'));
beforeEach(function() { beforeEach(function() {
settings = { settings = {
OPENSTACK_HYPERVISOR_FEATURES: { OPENSTACK_HYPERVISOR_FEATURES: {
requires_keypair: false requires_keypair: false
} }
}; };
}); });
beforeEach(module(function ($provide) { beforeEach(module(function ($provide) {
$provide.value('$modal', $modal); $provide.value('$modal', $modal);

View File

@ -25,50 +25,50 @@
var novaExtensionsEnabled = false; var novaExtensionsEnabled = false;
var novaApi = { var novaApi = {
createServer: function(finalSpec) { createServer: function(finalSpec) {
return { return {
then: function () { then: function () {
return finalSpec; return finalSpec;
} }
}; };
}, },
getAvailabilityZones: function() { getAvailabilityZones: function() {
var zones = [ var zones = [
{ zoneName: 'zone-1', zoneState: { available: true } }, { zoneName: 'zone-1', zoneState: { available: true } },
{ zoneName: 'zone-2', zoneState: { available: true } }, { zoneName: 'zone-2', zoneState: { available: true } },
{ zoneName: 'invalid-zone-1' }, { zoneName: 'invalid-zone-1' },
{ zoneName: 'invalid-zone-2' } { zoneName: 'invalid-zone-2' }
]; ];
var deferred = $q.defer(); var deferred = $q.defer();
deferred.resolve({ data: { items: zones } }); deferred.resolve({ data: { items: zones } });
return deferred.promise; return deferred.promise;
}, },
getFlavors: function() { getFlavors: function() {
var flavors = [ 'flavor-1', 'flavor-2' ]; var flavors = [ 'flavor-1', 'flavor-2' ];
var deferred = $q.defer(); var deferred = $q.defer();
deferred.resolve({ data: { items: flavors } }); deferred.resolve({ data: { items: flavors } });
return deferred.promise; return deferred.promise;
}, },
getKeypairs: function() { getKeypairs: function() {
var keypairs = [ { keypair: { name: 'key-1' } }, var keypairs = [ { keypair: { name: 'key-1' } },
{ keypair: { name: 'key-2' } } ]; { keypair: { name: 'key-2' } } ];
var deferred = $q.defer(); var deferred = $q.defer();
deferred.resolve({ data: { items: keypairs } }); deferred.resolve({ data: { items: keypairs } });
return deferred.promise; return deferred.promise;
}, },
getLimits: function() { getLimits: function() {
var limits = { maxTotalInstances: 10, totalInstancesUsed: 0 }; var limits = { maxTotalInstances: 10, totalInstancesUsed: 0 };
var deferred = $q.defer(); var deferred = $q.defer();
deferred.resolve({ data: limits }); deferred.resolve({ data: limits });
return deferred.promise; return deferred.promise;
} }
}; };
beforeEach(module('horizon.dashboard.project.workflow.launch-instance')); beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));

View File

@ -358,8 +358,8 @@
var promise = apiService.get('/api/glance/metadefs/namespaces/', config); var promise = apiService.get('/api/glance/metadefs/namespaces/', config);
return suppressError ? promise : promise.error(function() { return suppressError ? promise : promise.error(function() {
toastService.add('error', gettext('Unable to retrieve the namespaces.')); toastService.add('error', gettext('Unable to retrieve the namespaces.'));
}); });
} }
/** /**

View File

@ -6,7 +6,7 @@
"repository": "none", "repository": "none",
"license": "Apache 2.0", "license": "Apache 2.0",
"devDependencies": { "devDependencies": {
"eslint": "1.2.1", "eslint": "1.10.3",
"eslint-config-openstack": "1.2.3", "eslint-config-openstack": "1.2.3",
"eslint-plugin-angular": "0.15.0", "eslint-plugin-angular": "0.15.0",
"jasmine-core": "2.2.0", "jasmine-core": "2.2.0",