Fix eslint eqeqeq in es5 files

[MAILPOET-1145]
This commit is contained in:
Pavel Dohnal
2018-02-19 15:43:58 +00:00
parent f7fcec7953
commit 0ff9c006d8
6 changed files with 13 additions and 14 deletions

View File

@@ -35,7 +35,6 @@
"default-case": 0, "default-case": 0,
"no-lonely-if": 0, "no-lonely-if": 0,
"no-mixed-operators": 0, "no-mixed-operators": 0,
"eqeqeq": 0,
"brace-style": 0, "brace-style": 0,
"space-infix-ops": 0 "space-infix-ops": 0
} }

View File

@@ -24,7 +24,7 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) {
// set date format // set date format
f = block.hash.format || 'MMM Do, YYYY'; f = block.hash.format || 'MMM Do, YYYY';
// check if we passed a timestamp // check if we passed a timestamp
if (parseInt(timestamp, 10) == timestamp) { if (/^\d+$/.test(timestamp)) {
return window.moment.unix(timestamp).format(f); return window.moment.unix(timestamp).format(f);
} }
return window.moment.utc(timestamp).format(f); return window.moment.utc(timestamp).format(f);
@@ -40,11 +40,11 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) {
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) { Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
switch (operator) { switch (operator) {
case '==': case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this); return (v1 == v2) ? options.fn(this) : options.inverse(this); // eslint-disable-line eqeqeq
case '===': case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this); return (v1 === v2) ? options.fn(this) : options.inverse(this);
case '!=': case '!=':
return (v1 != v2) ? options.fn(this) : options.inverse(this); return (v1 != v2) ? options.fn(this) : options.inverse(this); // eslint-disable-line eqeqeq
case '!==': case '!==':
return (v1 !== v2) ? options.fn(this) : options.inverse(this); return (v1 !== v2) ? options.fn(this) : options.inverse(this);
case '<': case '<':

View File

@@ -418,7 +418,7 @@ define('modal', ['mailpoet', 'jquery'],
return this; return this;
}, },
focus: function () { focus: function () {
if (this.options.type == 'popup') { if (this.options.type === 'popup') {
jQuery('#mailpoet_' + this.options.type).focus(); jQuery('#mailpoet_' + this.options.type).focus();
} else { } else {
// panel and subpanel // panel and subpanel

View File

@@ -299,10 +299,10 @@ define([
}, },
changeReadMoreType: function (event) { changeReadMoreType: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'link') { if (value === 'link') {
this.$('.mailpoet_automated_latest_content_read_more_text').removeClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_read_more_text').removeClass('mailpoet_hidden');
this.$('.mailpoet_automated_latest_content_select_button').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_select_button').addClass('mailpoet_hidden');
} else if (value == 'button') { } else if (value === 'button') {
this.$('.mailpoet_automated_latest_content_read_more_text').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_read_more_text').addClass('mailpoet_hidden');
this.$('.mailpoet_automated_latest_content_select_button').removeClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_select_button').removeClass('mailpoet_hidden');
} }
@@ -311,7 +311,7 @@ define([
changeDisplayType: function (event) { changeDisplayType: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'titleOnly') { if (value === 'titleOnly') {
this.$('.mailpoet_automated_latest_content_title_as_list').removeClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_title_as_list').removeClass('mailpoet_hidden');
this.$('.mailpoet_automated_latest_content_image_full_width_option').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_image_full_width_option').addClass('mailpoet_hidden');
this.$('.mailpoet_automated_latest_content_image_separator').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_image_separator').addClass('mailpoet_hidden');
@@ -337,7 +337,7 @@ define([
}, },
changeTitleFormat: function (event) { changeTitleFormat: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'ul') { if (value === 'ul') {
this.$('.mailpoet_automated_latest_content_non_title_list_options').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_non_title_list_options').addClass('mailpoet_hidden');
this.model.set('titleIsLink', true); this.model.set('titleIsLink', true);

View File

@@ -524,10 +524,10 @@ define([
}, },
changeReadMoreType: function (event) { changeReadMoreType: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'link') { if (value === 'link') {
this.$('.mailpoet_posts_read_more_text').removeClass('mailpoet_hidden'); this.$('.mailpoet_posts_read_more_text').removeClass('mailpoet_hidden');
this.$('.mailpoet_posts_select_button').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_select_button').addClass('mailpoet_hidden');
} else if (value == 'button') { } else if (value === 'button') {
this.$('.mailpoet_posts_read_more_text').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_read_more_text').addClass('mailpoet_hidden');
this.$('.mailpoet_posts_select_button').removeClass('mailpoet_hidden'); this.$('.mailpoet_posts_select_button').removeClass('mailpoet_hidden');
} }
@@ -535,7 +535,7 @@ define([
}, },
changeDisplayType: function (event) { changeDisplayType: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'titleOnly') { if (value === 'titleOnly') {
this.$('.mailpoet_posts_title_as_list').removeClass('mailpoet_hidden'); this.$('.mailpoet_posts_title_as_list').removeClass('mailpoet_hidden');
this.$('.mailpoet_posts_image_full_width_option').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_full_width_option').addClass('mailpoet_hidden');
this.$('.mailpoet_posts_image_separator').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_separator').addClass('mailpoet_hidden');
@@ -562,7 +562,7 @@ define([
}, },
changeTitleFormat: function (event) { changeTitleFormat: function (event) {
var value = jQuery(event.target).val(); var value = jQuery(event.target).val();
if (value == 'ul') { if (value === 'ul') {
this.$('.mailpoet_posts_non_title_list_options').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_non_title_list_options').addClass('mailpoet_hidden');
this.model.set('titleIsLink', true); this.model.set('titleIsLink', true);

View File

@@ -613,7 +613,7 @@ define(
template: jQuery('#new_segment_template').html() template: jQuery('#new_segment_template').html()
}); });
jQuery('#new_segment_name').keypress(function (e) { jQuery('#new_segment_name').keypress(function (e) {
if (e.which == 13) { if (e.which === 13) {
jQuery('#new_segment_process').click(); jQuery('#new_segment_process').click();
} }
}); });