Fix eslint no-lonely-if in es5 files

[MAILPOET-1145]
This commit is contained in:
Pavel Dohnal
2018-02-19 15:54:19 +00:00
parent 704e4e40f7
commit 426a72c557
5 changed files with 22 additions and 36 deletions

View File

@ -33,7 +33,6 @@
"wrap-iife": 0,
"no-plusplus": 0,
"default-case": 0,
"no-lonely-if": 0,
"brace-style": 0,
"space-infix-ops": 0
}

View File

@ -155,8 +155,7 @@ define('date',
if (escapeToken === true) {
convertedFormat.push('[' + token + ']');
escapeToken = false;
} else {
if (token === '\\') {
} else if (token === '\\') {
// Slash escapes the next symbol to be treated as literal
escapeToken = true;
continue;
@ -166,7 +165,6 @@ define('date',
convertedFormat.push('[' + token + ']');
}
}
}
return convertedFormat.join('');
}

View File

@ -582,12 +582,10 @@ WysijaForm = {
if (window.isRtl) {
if (WysijaForm.toolbar.left === null) WysijaForm.toolbar.left = 0;
} else {
if (WysijaForm.toolbar.left === null) {
} else if (WysijaForm.toolbar.left === null) {
WysijaForm.toolbar.left =
parseInt(window.$(WysijaForm.options.container).positionedOffset().left);
}
}
if (WysijaForm.toolbar.x === null) {
WysijaForm.toolbar.x =
parseInt(

View File

@ -80,11 +80,7 @@ define(
: val;
cur = cur[key];
}
} else {
// Simple key, even simpler rules, since only scalars and shallow
// arrays are allowed.
if ($.isArray(obj[key])) {
} else if ($.isArray(obj[key])) {
// val is already an array, so push on the next value.
obj[key].push(val);
} else if (obj[key] !== undefined) {
@ -95,7 +91,6 @@ define(
// val is a scalar.
obj[key] = val;
}
}
});
return obj;

View File

@ -559,11 +559,9 @@ define('modal', ['mailpoet', 'jquery'],
.subpanels[(this.subpanels.length - 1)]
.onSuccess(this.subpanels[(this.subpanels.length - 1)].data);
}
} else {
if (this.options.onSuccess !== null) {
} else if (this.options.onSuccess !== null) {
this.options.onSuccess(this.options.data);
}
}
this.close();
return this;
@ -575,11 +573,9 @@ define('modal', ['mailpoet', 'jquery'],
.subpanels[(this.subpanels.length - 1)]
.onCancel(this.subpanels[(this.subpanels.length - 1)].data);
}
} else {
if (this.options.onCancel !== null) {
} else if (this.options.onCancel !== null) {
this.options.onCancel(this.options.data);
}
}
this.close();
return this;