From 6cc5ce1fa79449ee7e1bc44f040097c78e25cda8 Mon Sep 17 00:00:00 2001 From: woodm1979 Date: Fri, 22 Jul 2016 15:49:00 -0600 Subject: [PATCH] No more no-extra-parens eslint errors Running eslint is effectively useless nowdays because of the overwhelming number of warnings returned. This patch fixes the existing "no-extra-parens" errors. I've decided to only fix those errors here to keep the patch small, and not destroy any chance of success by needing to rebase every 5 minutes. Other fixes will be incoming. Change-Id: I634eafd359b14f40b89c2b30995557432cbb1b99 Partial-Bug: #1554824 --- horizon/static/framework/util/filters/filters.js | 6 +++--- .../util/validators/hz-password-match.directive.js | 2 +- .../magic-search/hz-magic-search-context.directive.js | 4 ++-- .../static/framework/widgets/wizard/wizard.controller.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/horizon/static/framework/util/filters/filters.js b/horizon/static/framework/util/filters/filters.js index 4e1529fda6..f6c8a728fc 100644 --- a/horizon/static/framework/util/filters/filters.js +++ b/horizon/static/framework/util/filters/filters.js @@ -133,7 +133,7 @@ function noValueFilter() { return function (input, def) { if (input === null || angular.isUndefined(input) || - (angular.isString(input) && '' === input.trim())) { + angular.isString(input) && '' === input.trim()) { return def || gettext('-'); } else { return input; @@ -208,9 +208,9 @@ function itemCountFilter() { function ensureNonNegative(input) { - var isNumeric = (input !== null && isFinite(input)); + var isNumeric = input !== null && isFinite(input); var number = isNumeric ? Math.round(input) : 0; - return (number > 0) ? number : 0; + return number > 0 ? number : 0; } return function (input, totalInput) { diff --git a/horizon/static/framework/util/validators/hz-password-match.directive.js b/horizon/static/framework/util/validators/hz-password-match.directive.js index 017b030421..3fb8a8c9c3 100644 --- a/horizon/static/framework/util/validators/hz-password-match.directive.js +++ b/horizon/static/framework/util/validators/hz-password-match.directive.js @@ -70,7 +70,7 @@ // helper function to check that password matches function passwordCheck() { scope.$apply(function () { - var match = (ctrl.$modelValue === pwElement.val()); + var match = ctrl.$modelValue === pwElement.val(); ctrl.$setValidity('match', match); }); } diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js index 425d1c9f6e..6fe361e3d1 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js @@ -106,9 +106,9 @@ cancel: gettext('Cancel'), prompt: gettext('Click here for filters.'), remove: gettext('Remove'), - text: (scope.clientFullTextSearch + text: scope.clientFullTextSearch ? gettext('Search in current results') - : gettext('Full Text Search')) + : gettext('Full Text Search') }; scope.filterStrings = filterStrings || defaultFilterStrings; diff --git a/horizon/static/framework/widgets/wizard/wizard.controller.js b/horizon/static/framework/widgets/wizard/wizard.controller.js index e0c88dc8d2..6cdacfcc32 100644 --- a/horizon/static/framework/widgets/wizard/wizard.controller.js +++ b/horizon/static/framework/widgets/wizard/wizard.controller.js @@ -190,7 +190,7 @@ } }); - viewModel.ready = (stepReadyPromises.length === 0); + viewModel.ready = stepReadyPromises.length === 0; return $q.all(stepReadyPromises); }