diff --git a/.eslintrc.es5.json b/.eslintrc.es5.json index 99a44b7e15..93521a335e 100644 --- a/.eslintrc.es5.json +++ b/.eslintrc.es5.json @@ -35,7 +35,6 @@ "default-case": 0, "no-lonely-if": 0, "no-mixed-operators": 0, - "eqeqeq": 0, "brace-style": 0, "space-infix-ops": 0 } diff --git a/assets/js/src/handlebars_helpers.js b/assets/js/src/handlebars_helpers.js index 29c3c9abef..47132cff3c 100644 --- a/assets/js/src/handlebars_helpers.js +++ b/assets/js/src/handlebars_helpers.js @@ -24,7 +24,7 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) { // set date format f = block.hash.format || 'MMM Do, YYYY'; // 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.utc(timestamp).format(f); @@ -40,11 +40,11 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) { Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) { switch (operator) { case '==': - return (v1 == v2) ? options.fn(this) : options.inverse(this); + return (v1 == v2) ? options.fn(this) : options.inverse(this); // eslint-disable-line eqeqeq case '===': return (v1 === v2) ? options.fn(this) : options.inverse(this); case '!=': - return (v1 != v2) ? options.fn(this) : options.inverse(this); + return (v1 != v2) ? options.fn(this) : options.inverse(this); // eslint-disable-line eqeqeq case '!==': return (v1 !== v2) ? options.fn(this) : options.inverse(this); case '<': diff --git a/assets/js/src/modal.js b/assets/js/src/modal.js index 1f9b57513e..bb69818b39 100644 --- a/assets/js/src/modal.js +++ b/assets/js/src/modal.js @@ -418,7 +418,7 @@ define('modal', ['mailpoet', 'jquery'], return this; }, focus: function () { - if (this.options.type == 'popup') { + if (this.options.type === 'popup') { jQuery('#mailpoet_' + this.options.type).focus(); } else { // panel and subpanel diff --git a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js index 4b3c158e73..fd1e9669c8 100644 --- a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js +++ b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js @@ -299,10 +299,10 @@ define([ }, changeReadMoreType: function (event) { 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_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_select_button').removeClass('mailpoet_hidden'); } @@ -311,7 +311,7 @@ define([ changeDisplayType: function (event) { 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_image_full_width_option').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_image_separator').addClass('mailpoet_hidden'); @@ -337,7 +337,7 @@ define([ }, changeTitleFormat: function (event) { 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.model.set('titleIsLink', true); diff --git a/assets/js/src/newsletter_editor/blocks/posts.js b/assets/js/src/newsletter_editor/blocks/posts.js index 73834fd171..108b83c095 100644 --- a/assets/js/src/newsletter_editor/blocks/posts.js +++ b/assets/js/src/newsletter_editor/blocks/posts.js @@ -524,10 +524,10 @@ define([ }, changeReadMoreType: function (event) { var value = jQuery(event.target).val(); - if (value == 'link') { + if (value === 'link') { this.$('.mailpoet_posts_read_more_text').removeClass('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_select_button').removeClass('mailpoet_hidden'); } @@ -535,7 +535,7 @@ define([ }, changeDisplayType: function (event) { var value = jQuery(event.target).val(); - if (value == 'titleOnly') { + if (value === 'titleOnly') { this.$('.mailpoet_posts_title_as_list').removeClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_full_width_option').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_separator').addClass('mailpoet_hidden'); @@ -562,7 +562,7 @@ define([ }, changeTitleFormat: function (event) { var value = jQuery(event.target).val(); - if (value == 'ul') { + if (value === 'ul') { this.$('.mailpoet_posts_non_title_list_options').addClass('mailpoet_hidden'); this.model.set('titleIsLink', true); diff --git a/assets/js/src/subscribers/importExport/import.js b/assets/js/src/subscribers/importExport/import.js index 8dca40d9e1..3aa5ac9f8f 100644 --- a/assets/js/src/subscribers/importExport/import.js +++ b/assets/js/src/subscribers/importExport/import.js @@ -613,7 +613,7 @@ define( template: jQuery('#new_segment_template').html() }); jQuery('#new_segment_name').keypress(function (e) { - if (e.which == 13) { + if (e.which === 13) { jQuery('#new_segment_process').click(); } });