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, "wrap-iife": 0,
"no-plusplus": 0, "no-plusplus": 0,
"default-case": 0, "default-case": 0,
"no-lonely-if": 0,
"brace-style": 0, "brace-style": 0,
"space-infix-ops": 0 "space-infix-ops": 0
} }

View File

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

View File

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

View File

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

View File

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