Skip to content

Commit

Permalink
Unified no-unary-ops eslint rule to no space before unary operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Nov 9, 2018
1 parent 0f8ce88 commit c53945a
Show file tree
Hide file tree
Showing 77 changed files with 234 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"words": true,
"nonwords": false,
"overrides": {
"!": true
"!": false
}
}],
"no-unused-vars": [ "error", {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/ansible-raw-stdout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ManageIQ.angular.app.component('ansibleRawStdout', {
vm.data = null;

vm.$onInit = function() {
if (! vm.taskId) {
if (!vm.taskId) {
vm.loading = false;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/components/auth-credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ ManageIQ.angular.app.component('authCredentials', {
};

this.showChangePasswordLinks = function(index) {
return ! vm.newRecord && (vm.modelCopy[vm.prefix + '_protocol'] === vm.formModel[vm.prefix + '_protocol']) && vm.formModel[index];
return !vm.newRecord && (vm.modelCopy[vm.prefix + '_protocol'] === vm.formModel[vm.prefix + '_protocol']) && vm.formModel[index];
};

this.showVerify = function(userid) {
return vm.newRecord || (! vm.showChangePasswordLinks(userid)) || vm.bChangeStoredPassword;
return vm.newRecord || (!vm.showChangePasswordLinks(userid)) || vm.bChangeStoredPassword;
};
$scope.$on('resetClicked', function(_e) {
vm.cancelPasswordChange();
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/datetime-delay-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ManageIQ.angular.app.component('datetimeDelayPicker', {
};

this.$onInit = function() {
if (! this.start_date) {
if (!this.start_date) {
this.start_date = new Date();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function customImageComponentController($timeout) {
};

vm.changeImageSelected = function() {
if (! vm.changeImage) {
if (!vm.changeImage) {
restoreOriginalStatus();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function genericObjectDefinitionFormController(API, miqService, $q) {

assignAllObjectsToKeyValueArrays(true);

vm.pictureReset = ! vm.pictureReset;
vm.pictureReset = !vm.pictureReset;

angularForm.$setUntouched(true);
angularForm.$setPristine(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function genericObjectDefinitionToolbarController(API, miqService, $window) {
// private functions
function postGenericObjectDefinitionAction() {
var currentRecordId = toolbar.recordId || ManageIQ.record.recordId;
if (toolbar.action === 'delete' && ! currentRecordId) {
if (toolbar.action === 'delete' && !currentRecordId) {
_.forEach(toolbar.genericObjectDefinitions, function(recordId) {
API.get('/api/generic_object_definitions/' + recordId + '?attributes=generic_objects_count')
.then(checkGenericObjectCountAndDelete)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function genericObjectTableController($timeout) {
vm.keys.push('');
vm.noOfRows = _.size(vm.keys);

if (! addFromOtherSource) {
if (!addFromOtherSource) {
$timeout(function() {
angular.element('#' + element).focus();
});
Expand Down Expand Up @@ -119,8 +119,8 @@ function genericObjectTableController($timeout) {
}

function checkIfTableChanged() {
if (vm.values && ! angular.equals(_.zipObject(vm.keys, vm.values), vm.origKeysValues)
|| ! vm.values && _.difference(vm.keys, vm.origKeysValues).length > 0) {
if (vm.values && !angular.equals(_.zipObject(vm.keys, vm.values), vm.origKeysValues)
|| !vm.values && _.difference(vm.keys, vm.origKeysValues).length > 0) {
vm.tableChanged = true;
} else {
vm.tableChanged = false;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/miq-request-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ManageIQ.angular.app.component('miqRequestOptions', {
};

this.appliedStatesBlank = function() {
return ! this.options.states.find(function(state) {
return !this.options.states.find(function(state) {
return state.checked;
});
};
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/ops/tenant-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function tenantFormController(API, miqService) {
// private functions
function getTenantFormData(response) {
Object.assign(vm.tenantModel, response);
vm.tenantModel.default = ! angular.isDefined(response.ancestry);
vm.tenantModel.default = !angular.isDefined(response.ancestry);

vm.afterGet = true;
vm.entity = vm.tenantModel.divisible ? __('Tenant') : __('Project');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function c3ChartController($timeout, $attrs) {
chartData.bindto = '#' + $attrs.id;
// only re-generate donut pct chart if it has a threshold object
// because it's colors will change based on data and thresholds
if (! chart || ($attrs.id.indexOf('donutPctChart') !== -1 && chartData.thresholds)) {
if (!chart || ($attrs.id.indexOf('donutPctChart') !== -1 && chartData.thresholds)) {
chart = c3.generate(chartData);
} else {
// if chart is already created, then we only need to re-load data
Expand All @@ -42,7 +42,7 @@ function c3ChartController($timeout, $attrs) {

vm.$doCheck = function() {
// do a deep compare on config
if (! angular.equals(vm.config, prevConfig)) {
if (!angular.equals(vm.config, prevConfig)) {
vm.generateChart();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function donutChartController(pfUtils) {
var total = 0;
angular.forEach(vm.data, function(value) {
angular.forEach(value, function(innerValue) {
if (! isNaN(innerValue)) {
if (!isNaN(innerValue)) {
total += Number(innerValue);
}
});
Expand Down Expand Up @@ -79,15 +79,15 @@ function donutChartController(pfUtils) {
}

donutChartTitle = d3.select(vm.chart.element).select('text.c3-chart-arcs-title');
if (! donutChartTitle) {
if (!donutChartTitle) {
return;
}

centerLabelText = vm.getCenterLabelText();

// Remove any existing title.
donutChartTitle.text('');
if (centerLabelText.bigText && ! centerLabelText.smText) {
if (centerLabelText.bigText && !centerLabelText.smText) {
donutChartTitle.text(centerLabelText.bigText);
} else {
donutChartTitle.insert('tspan').text(centerLabelText.bigText).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
Expand All @@ -111,7 +111,7 @@ function donutChartController(pfUtils) {

vm.$doCheck = function() {
// do a deep compare on data
if (! angular.equals(vm.data, prevData)) {
if (!angular.equals(vm.data, prevData)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function donutPctChartController(pfUtils) {
}
}

if (! vm.threshold || vm.threshold !== threshold) {
if (!vm.threshold || vm.threshold !== threshold) {
vm.threshold = threshold;
vm.onThresholdChange({ threshold: vm.threshold });
}
Expand Down Expand Up @@ -149,15 +149,15 @@ function donutPctChartController(pfUtils) {
}

donutChartTitle = d3.select(vm.chart.element).select('text.c3-chart-arcs-title');
if (! donutChartTitle) {
if (!donutChartTitle) {
return;
}

centerLabelText = vm.getCenterLabelText();

// Remove any existing title.
donutChartTitle.selectAll('*').remove();
if (centerLabelText.bigText && ! centerLabelText.smText) {
if (centerLabelText.bigText && !centerLabelText.smText) {
donutChartTitle.text(centerLabelText.bigText);
} else {
donutChartTitle.insert('tspan').text(centerLabelText.bigText).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
Expand All @@ -184,7 +184,7 @@ function donutPctChartController(pfUtils) {

vm.$doCheck = function() {
// do a deep compare on data
if (! angular.equals(vm.data, prevData)) {
if (!angular.equals(vm.data, prevData)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function groupChartController() {

vm.$doCheck = function() {
// do a deep compare on chartData and config
if (! angular.equals(vm.chartData, prevChartData) || ! angular.equals(vm.config, prevConfig)) {
if (!angular.equals(vm.chartData, prevChartData) || !angular.equals(vm.config, prevConfig)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ angular.module('patternfly.charts').component('pfHeatmapLegend', {
var items = [];

// Allow overriding of defaults
if (! vm.legendColors) {
if (!vm.legendColors) {
vm.legendColors = heatmapColorPatternDefaults;
}
if (! vm.legend) {
if (!vm.legend) {
vm.legend = legendLabelDefaults;
}
for (var i = vm.legend.length - 1; i >= 0; i--) {
Expand All @@ -35,10 +35,10 @@ angular.module('patternfly.charts').component('pfHeatmapLegend', {
};

vm.$onChanges = function(changesObj) {
if (changesObj.legend && ! changesObj.legend.isFirstChange()) {
if (changesObj.legend && !changesObj.legend.isFirstChange()) {
vm.updateAll();
}
if (changesObj.legendColors && ! changesObj.legendColors.isFirstChange()) {
if (changesObj.legendColors && !changesObj.legendColors.isFirstChange()) {
vm.updateAll();
}
};
Expand Down
12 changes: 6 additions & 6 deletions app/assets/javascripts/components/pf_charts/heatmap.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,19 @@ function heatmapController($element, $window, $compile, $scope, $timeout) {

vm.rangeOnHover = (vm.rangeOnHover === undefined || vm.rangeOnHover) ? true : false;

if (! vm.rangeTooltips) {
if (!vm.rangeTooltips) {
vm.rangeTooltips = rangeTooltipDefaults;
}

if (! vm.thresholds) {
if (!vm.thresholds) {
vm.thresholds = thresholdDefaults;
}

if (! vm.heatmapColorPattern) {
if (!vm.heatmapColorPattern) {
vm.heatmapColorPattern = heatmapColorPatternDefaults;
}

if (! vm.legendLabels) {
if (!vm.legendLabels) {
vm.legendLabels = legendLabelDefaults;
}
vm.height = vm.height || heightDefault;
Expand All @@ -239,7 +239,7 @@ function heatmapController($element, $window, $compile, $scope, $timeout) {
};

vm.$onChanges = function(changesObj) {
if (changesObj.chartDataAvailable && ! changesObj.chartDataAvailable.isFirstChange()) {
if (changesObj.chartDataAvailable && !changesObj.chartDataAvailable.isFirstChange()) {
setStyles();
} else {
vm.updateAll();
Expand All @@ -249,7 +249,7 @@ function heatmapController($element, $window, $compile, $scope, $timeout) {

vm.$doCheck = function() {
// do a deep compare on chartData and config
if (! angular.equals(vm.data, prevData)) {
if (!angular.equals(vm.data, prevData)) {
setStyles();
if (vm.chartDataAvailable !== false) {
setSizes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function lineChartController(pfUtils) {

vm.$doCheck = function() {
// do a deep compare on chartData
if (! angular.equals(vm.chartData, prevChartData)) {
if (!angular.equals(vm.chartData, prevChartData)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function pieChartController(pfUtils) {

vm.$doCheck = function() {
// do a deep compare on data
if (! angular.equals(vm.data, prevData)) {
if (!angular.equals(vm.data, prevData)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function sparklineChartController(pfUtils, $document) {

vm.$doCheck = function() {
// do a deep compare on chartData
if (! angular.equals(vm.chartData, prevChartData)) {
if (!angular.equals(vm.chartData, prevChartData)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ function trendsChartController() {
prevChartData = angular.copy(vm.chartData);
prevConfig = angular.copy(vm.config);

vm.showLargeCardLayout = (! vm.config.layout || vm.config.layout === 'large');
vm.showLargeCardLayout = (!vm.config.layout || vm.config.layout === 'large');
vm.showSmallCardLayout = (vm.config.layout === 'small');
vm.showActualValue = (! vm.config.valueType || vm.config.valueType === 'actual');
vm.showActualValue = (!vm.config.valueType || vm.config.valueType === 'actual');
vm.showPercentageValue = (vm.config.valueType === 'percentage');
};

Expand Down Expand Up @@ -61,7 +61,7 @@ function trendsChartController() {

vm.$doCheck = function() {
// do a deep compare on chartData and config
if (! angular.equals(vm.chartData, prevChartData) || ! angular.equals(vm.config, prevConfig)) {
if (!angular.equals(vm.chartData, prevChartData) || !angular.equals(vm.config, prevConfig)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function utilizationTrendChartController() {

vm.$doCheck = function() {
// do a deep compare on chartData and config
if (! angular.equals(vm.chartData, prevChartData) || ! angular.equals(vm.config, prevConfig)) {
if (!angular.equals(vm.chartData, prevChartData) || !angular.equals(vm.config, prevConfig)) {
vm.updateAll();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@

vm.confirmation_and_new_password_are_different = function() {
if (vm.model.confirm_password) {
return ! isFieldsEquals(vm.model.confirm_password, vm.model.new_password);
return !isFieldsEquals(vm.model.confirm_password, vm.model.new_password);
}
return false;
};

vm.saveable = function() {
return !! (vm.model.current_password
return !!(vm.model.current_password
&& vm.model.new_password
&& vm.model.confirm_password
&& ! vm.confirmation_and_new_password_are_different()
&& ! vm.current_and_new_password_are_equals());
&& !vm.confirmation_and_new_password_are_different()
&& !vm.current_and_new_password_are_equals());
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/verify-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ManageIQ.angular.app.component('verifyButton', {

vm.findScope = function() {
var parentScope = $scope;
while (! parentScope.angularForm) {
while (!parentScope.angularForm) {
parentScope = parentScope.$parent;
}
return parentScope.angularForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function vmCloudAddSecurityGroupFormController(API, miqService, $q) {
})
.then(function(data) {
vm.security_groups = data.resources.filter(function(securityGroup) {
return ! _.find(currentSecurityGroups, { id: securityGroup.id });
return !_.find(currentSecurityGroups, { id: securityGroup.id });
});

vm.afterGet = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ angular.module('alertsCenter').controller('alertsListController',
}

function expandRow(item) {
if (! item.disableRowExpansion) {
item.isExpanded = ! item.isExpanded;
if (!item.disableRowExpansion) {
item.isExpanded = !item.isExpanded;
}
return false;
}
Expand Down
Loading

0 comments on commit c53945a

Please sign in to comment.