From daa169c0944df674f7e3d8cf41ca1a389f97618c Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Sat, 18 Feb 2017 12:40:57 -0700 Subject: [PATCH] ESlint no-unused-expressions --- .eslintrc | 2 +- public/src/modules/pictureCropper.js | 6 +++++- public/src/modules/settings/object.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 51fd82fb85..5adcaa5543 100644 --- a/.eslintrc +++ b/.eslintrc @@ -92,7 +92,7 @@ "no-extra-boolean-cast": "off", "no-script-url": "off", "no-path-concat": "off", - "no-unused-expressions": "off", + // "no-unused-expressions": "off", // "no-return-assign": "off", // "no-restricted-modules": "off", // "object-curly-spacing": "off", diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js index 6f23edbef1..119565cbe7 100644 --- a/public/src/modules/pictureCropper.js +++ b/public/src/modules/pictureCropper.js @@ -50,7 +50,11 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe cropperModal.find('.flip').on('click', function () { var option = this.getAttribute('data-option'); var method = this.getAttribute('data-method'); - method === 'scaleX' ? cropperTool.scaleX(option) : cropperTool.scaleY(option); + if (method === 'scaleX') { + cropperTool.scaleX(option); + } else { + cropperTool.scaleY(option); + } this.setAttribute('data-option', option * -1); }); diff --git a/public/src/modules/settings/object.js b/public/src/modules/settings/object.js index c1dbce7dc4..d7f7bbda23 100644 --- a/public/src/modules/settings/object.js +++ b/public/src/modules/settings/object.js @@ -23,7 +23,7 @@ define('settings/object', function () { delete attributes['data-prepend']; delete attributes['data-append']; attributes = helper.deepClone(attributes); - type = attributes['data-type'] || attributes.type || 'text', + type = attributes['data-type'] || attributes.type || 'text'; element = $(helper.createElementOfType(type, attributes.tagName, attributes)); element.attr('data-parent', '_' + key); element.attr('data-prop', prop);