diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/chart.js b/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/chart.js index 978ac946c3a00..251399ad31ec0 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/chart.js +++ b/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/chart.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/*global define*/ /*global FORM_KEY*/ define([ 'jquery', diff --git a/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/totals.js b/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/totals.js index 2a696fe7bb38c..5de9223b47c40 100644 --- a/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/totals.js +++ b/app/code/Magento/Backend/view/adminhtml/web/js/dashboard/totals.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/*global define*/ /*global FORM_KEY*/ define([ 'jquery', diff --git a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js index f4417f93685ea..f40ae7b24df7b 100644 --- a/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js +++ b/app/code/Magento/Bundle/view/adminhtml/web/js/bundle-product.js @@ -5,7 +5,6 @@ /*global FORM_KEY*/ /*global bSelection*/ -/*global $H*/ /** * @api */ @@ -186,7 +185,9 @@ define([ }); bSelection.gridRemoval.each(function (pair) { $optionBox.find('.col-sku').filter(function () { - return $(this).text().trim() === pair.key; // find row by SKU + let text = $(this).text(); + + return text.trim() === pair.key; // find row by SKU }).closest('tr').find('button.delete').trigger('click'); }); widget.refreshSortableElements(); diff --git a/app/code/Magento/Captcha/view/frontend/web/js/model/captcha.js b/app/code/Magento/Captcha/view/frontend/web/js/model/captcha.js index e79cfb35ee08d..a0e6a87c9bb3a 100644 --- a/app/code/Magento/Captcha/view/frontend/web/js/model/captcha.js +++ b/app/code/Magento/Captcha/view/frontend/web/js/model/captcha.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/*global alert*/ define([ 'jquery', 'ko', diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js index 37c05e69d0152..648a18a3c0968 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/base-image-uploader.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/*global alert:true*/ define([ 'jquery', 'mage/template', diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js index 35b8958f2f8fd..68063b874d435 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/assign-products.js @@ -3,8 +3,6 @@ * See COPYING.txt for license details. */ -/* global $, $H */ - define([ 'mage/adminhtml/grid' ], function () { diff --git a/app/code/Magento/Catalog/view/base/web/js/price-utils.js b/app/code/Magento/Catalog/view/base/web/js/price-utils.js index 7b83d12cc9804..b75326c4ae8d7 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-utils.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-utils.js @@ -27,7 +27,7 @@ define([ * @return {String} */ function stringPad(string, times) { - return (new Array(times + 1)).join(string); + return new Array(times + 1).join(string); } /** diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js index af856992f8cdc..8ee6849e0f1f4 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/*global alert*/ define([ 'jquery' ], function ($) { diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js index ad50d0ae020ed..97cfb49201d2d 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/*global alert*/ + define([ 'jquery', 'mage/utils/wrapper', diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js index 2760a3632f140..96e0a734e2c68 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js +++ b/app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js @@ -159,7 +159,9 @@ define([ product.id = element.val(); product.qty = 0; element.closest('[data-role=row]').find('[data-column]').each(function (index, el) { - product[$(el).data('column')] = $(el).text().trim(); + let text = $(el).text(); + + product[$(el).data('column')] = text.trim(); }); selectedProductList[product.id] = product; } else { diff --git a/app/code/Magento/Integration/view/adminhtml/web/js/integration.js b/app/code/Magento/Integration/view/adminhtml/web/js/integration.js index dcfa68c9449bb..b1d7eba572a03 100644 --- a/app/code/Magento/Integration/view/adminhtml/web/js/integration.js +++ b/app/code/Magento/Integration/view/adminhtml/web/js/integration.js @@ -365,7 +365,7 @@ define([ try { // Get integration name either from current element or from neighbor column integrationName = $(ctx).attr('data-row-name') || - $(ctx).parents('tr').find('.col-name').html().trim(); + $(ctx).parents('tr').find('.col-name').html().trim(); // eslint-disable-line jquery-no-trim if (integrationName.indexOf(' -1) { // Remove unsecure URL warning from popup window title if it is present diff --git a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/messages.js b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/messages.js index 8ed802d53825a..69f2ffc20ee2f 100644 --- a/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/messages.js +++ b/app/code/Magento/MediaGalleryUi/view/adminhtml/web/js/grid/messages.js @@ -70,6 +70,7 @@ define([ delay = delay || this.messageDelay; + // eslint-disable-next-line no-unused-vars timerId = setTimeout(function () { clearTimeout(timerId); this.clear(); diff --git a/app/code/Magento/Paypal/view/adminhtml/web/js/payflowpro/vault.js b/app/code/Magento/Paypal/view/adminhtml/web/js/payflowpro/vault.js index 9c598135dc1d5..556a3719d0396 100644 --- a/app/code/Magento/Paypal/view/adminhtml/web/js/payflowpro/vault.js +++ b/app/code/Magento/Paypal/view/adminhtml/web/js/payflowpro/vault.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ + define([ 'jquery', 'uiComponent' diff --git a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js index 55116694e52be..47e58bf0f2f78 100644 --- a/app/code/Magento/Paypal/view/frontend/web/js/order-review.js +++ b/app/code/Magento/Paypal/view/frontend/web/js/order-review.js @@ -285,7 +285,9 @@ define([ isChecked = $(this.options.billingAsShippingSelector).is(':checked'); formData = null; callBackResponseHandler = null; - shippingMethod = $(this.options.shippingSelector).val().trim(); + let val = $(this.options.shippingSelector).val(); + + shippingMethod = val.trim(); this._shippingTobilling(); if (url && resultId && shippingMethod) { @@ -358,7 +360,9 @@ define([ * Actions on change Shipping Address data */ _onShippingChange: function () { - if (this.triggerPropertyChange && $(this.options.shippingSelector).val().trim()) { + let val = $(this.options.shippingSelector).val(); + + if (this.triggerPropertyChange && val.trim()) { this.element.find(this.options.shippingSelector).hide().end() .find(this.options.shippingSelector + '_update').show(); } diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js index c827370d4f221..47b309ed183b4 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js @@ -606,7 +606,7 @@ define([ * @private */ _formatVimeoDuration: function (seconds) { - return (new Date(seconds * 1000)).toUTCString().match(/(\d\d:\d\d:\d\d)/)[0]; + return new Date(seconds * 1000).toUTCString().match(/(\d\d:\d\d:\d\d)/)[0]; }, /** diff --git a/app/code/Magento/Security/view/adminhtml/web/js/system/config/session-size.js b/app/code/Magento/Security/view/adminhtml/web/js/system/config/session-size.js index 6d95a73fe6b6b..9133ac0b66978 100644 --- a/app/code/Magento/Security/view/adminhtml/web/js/system/config/session-size.js +++ b/app/code/Magento/Security/view/adminhtml/web/js/system/config/session-size.js @@ -17,7 +17,7 @@ define([ $inputEl.on('blur', function () { var inputVal = parseInt($inputEl.val(), 10); - if (256000 > inputVal) { + if (inputVal < 256000) { confirm({ title: $t(config.modalTitleText), content: $t(config.modalContentBody), diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js b/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js index 0cb800fdc30e5..41c7c836b0d07 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/form/element/swatch-visual.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ -/* global $break $ FORM_KEY */ +/* global FORM_KEY */ /** * @api diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/text.js b/app/code/Magento/Swatches/view/adminhtml/web/js/text.js index 92b000f253dfb..c2d923df1953f 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/text.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/text.js @@ -3,8 +3,6 @@ * See COPYING.txt for license details. */ -/* global $break $ $$ */ - /** * @api */ diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js b/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js index 48e815bdc4a77..2f9705c3af11e 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/visual.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ -/* global $break $ $$ FORM_KEY */ +/* global FORM_KEY */ /** * @api diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/events.js b/app/code/Magento/Ui/view/base/web/js/lib/core/events.js index 15965fba1ad2d..eddec2d6a5b69 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/events.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/events.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/* global WeakMap, Map*/ define([ 'ko', 'underscore' diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js index 2ae4e24b50ec6..d6ded2d74de41 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/optgroup.js @@ -265,7 +265,7 @@ define([ * @returns {Array} */ function strPad(string, times) { - return (new Array(times + 1)).join(string); + return new Array(times + 1).join(string); } /** diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js index 0b80a75bf0c18..c2eb9341f6dfb 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/extender/bound-nodes.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/* global WeakMap */ define([ 'ko', 'underscore', diff --git a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js index 18e05b8daac68..42b670d86a69c 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/registry/registry.js @@ -6,7 +6,6 @@ /** * @api */ -/* global WeakMap */ define([ 'jquery', 'underscore' diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js index bc8e3095b5cd2..902e21bfb885e 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/raf.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ -/* global WeakMap */ define([], function () { 'use strict'; diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js b/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js index 9964e9f6b84e5..c82b0d5fd153c 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal-component.js @@ -234,7 +234,7 @@ define([ } if (typeof elem.validate === 'function') { - this.valid = this.valid & elem.validate().valid; + this.valid &= elem.validate().valid; } else if (elem.elems) { elem.elems().forEach(this.validate, this); } diff --git a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js index 1d0305a7046ab..26d835c1ae11a 100644 --- a/app/code/Magento/Vault/view/adminhtml/web/js/vault.js +++ b/app/code/Magento/Vault/view/adminhtml/web/js/vault.js @@ -3,7 +3,6 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ /* @api */ define([ 'jquery', diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js index 9a2e75f6c07d1..0c9073fec6b42 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/method-renderer/vault.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ + define( [ 'Magento_Checkout/js/view/payment/default', diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js index af4ddb362c6e9..854acd5b73776 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault-enabler.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ + /* @api */ define( [ diff --git a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js index eb29743416964..f926ebee1c667 100644 --- a/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js +++ b/app/code/Magento/Vault/view/frontend/web/js/view/payment/vault.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ + /* @api */ define([ 'underscore', diff --git a/composer.lock b/composer.lock index d757b9836b1b4..31b0936220504 100644 --- a/composer.lock +++ b/composer.lock @@ -9360,16 +9360,16 @@ }, { "name": "magento/magento-coding-standard", - "version": "16", + "version": "17", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "9dd071e644bd9f4e4c08ad8ad345270cecc66a2a" + "reference": "7fbdf31a451d29e412b836209459d0e2675128be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/9dd071e644bd9f4e4c08ad8ad345270cecc66a2a", - "reference": "9dd071e644bd9f4e4c08ad8ad345270cecc66a2a", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/7fbdf31a451d29e412b836209459d0e2675128be", + "reference": "7fbdf31a451d29e412b836209459d0e2675128be", "shasum": "" }, "require": { @@ -9378,7 +9378,7 @@ "php": ">=7.3", "phpcompatibility/php-compatibility": "^9.3", "rector/rector": "^0.12.4", - "squizlabs/php_codesniffer": "^3.6", + "squizlabs/php_codesniffer": "^3.6.1", "webonyx/graphql-php": "^14.9" }, "require-dev": { @@ -9402,9 +9402,9 @@ "description": "A set of Magento specific PHP CodeSniffer rules.", "support": { "issues": "https://github.com/magento/magento-coding-standard/issues", - "source": "https://github.com/magento/magento-coding-standard/tree/v16" + "source": "https://github.com/magento/magento-coding-standard/tree/v17" }, - "time": "2021-11-23T11:54:35+00:00" + "time": "2022-01-11T11:59:48+00:00" }, { "name": "magento/magento2-functional-testing-framework", diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/final-price.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/final-price.test.js index 13b68aa4d9ea7..3e9435b0d9f7e 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/final-price.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/final-price.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/image.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/image.test.js index 776677ea04f11..2c2a52d2b2a81 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/image.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/base/js/product/list/columns/image.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/data-storage.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/data-storage.test.js index 0ab6b5fdf2b99..f46fb1ab1f33c 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/data-storage.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/data-storage.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage-compare.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage-compare.test.js index aa68c498e0fea..689b9d3911bce 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage-compare.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage-compare.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage.test.js index 624b159163bcb..200b3f776cb99 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/ids-storage.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js index 1a3a5726080bc..d0af7346727b6 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/storage/storage-service.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/storage-manager.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/storage-manager.test.js index 571113f481bf3..49cc1a51edfd4 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/storage-manager.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/storage-manager.test.js @@ -2,7 +2,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -/* global jQuery */ + /* eslint-disable max-nested-callbacks */ define([ 'jquery', diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index 18714f4e40d31..9f43cb17952e2 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -481,7 +481,7 @@ define([ return; } //var dataElements = $(this.containerId+this.tableSufix).down('.data tbody').select('input', 'select'); - // eslint-disable-next-line jquery-no-click-event-shorthand + // eslint-disable-next-line jquery-no-input-event-shorthand dataElements = $(this.containerId + this.tableSufix).down('tbody').select('input', 'select'); for (i = 0; i < dataElements.length; i++) { @@ -1507,7 +1507,7 @@ define([ checkbox, checked; if (trElement) { - // eslint-disable-next-line jquery-no-click-event-shorthand + // eslint-disable-next-line jquery-no-input-event-shorthand checkbox = Element.select(trElement, 'input'); if (checkbox[0] && !checkbox[0].disabled) { @@ -1538,7 +1538,7 @@ define([ var checkbox, selectors, inputs, i; if (this.multidimensionalMode) { - // eslint-disable-next-line jquery-no-click-event-shorthand + // eslint-disable-next-line jquery-no-input-event-shorthand checkbox = $(row).select('.checkbox')[0]; selectors = this.inputsToManage.map(function (name) { return ['input[name="' + name + '"]', 'select[name="' + name + '"]']; diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js index 32673caf6de38..8c1bc7251c5ff 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js @@ -186,7 +186,7 @@ define([ * @returns {String} */ decodeVariables: function (content) { - var doc = (new DOMParser()).parseFromString(content.replace(/"/g, '&quot;'), 'text/html'), + var doc = new DOMParser().parseFromString(content.replace(/"/g, '&quot;'), 'text/html'), returnval = ''; [].forEach.call(doc.querySelectorAll('span.magento-variable'), function (el) { diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js index 0b0687e7d329c..3310d44b01122 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ -/* global tinymce, widgetTools, jQuery, Base64 */ +/* global tinymce, widgetTools, Base64 */ /* eslint-disable strict */ define([ 'wysiwygAdapter', diff --git a/lib/web/mage/backend/tabs.js b/lib/web/mage/backend/tabs.js index 698b32a7c6b35..0f3300da04381 100644 --- a/lib/web/mage/backend/tabs.js +++ b/lib/web/mage/backend/tabs.js @@ -391,7 +391,6 @@ define([ } }; options.action.args[this.options.tabIdArgument] = activeTabId; - data = data ? $.extend(data, options) : options; } }); diff --git a/lib/web/mage/requirejs/text.js b/lib/web/mage/requirejs/text.js index 74bc896890e74..9cec4ebd10046 100644 --- a/lib/web/mage/requirejs/text.js +++ b/lib/web/mage/requirejs/text.js @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /* inspired by http://github.com/requirejs/text */ -/*global XMLHttpRequest, XDomainRequest */ +/*global XDomainRequest */ define(['module'], function (module) { 'use strict'; diff --git a/lib/web/mage/validation/validation.js b/lib/web/mage/validation/validation.js index c8478ac84edd4..578d7968c4732 100644 --- a/lib/web/mage/validation/validation.js +++ b/lib/web/mage/validation/validation.js @@ -115,7 +115,7 @@ define([ day = parseInt(dayVal, 10) || 0; month = parseInt(monthVal, 10) || 0; year = parseInt(yearVal, 10) || 0; - curYear = (new Date()).getFullYear(); + curYear = new Date().getFullYear(); if (!day || !month || !year) { this.dobErrorMessage = $.mage.__('Please enter a valid full date.'); diff --git a/package.json.sample b/package.json.sample index d4dbbdf14a97b..f04ef5e904117 100644 --- a/package.json.sample +++ b/package.json.sample @@ -20,7 +20,7 @@ "grunt-contrib-jasmine": "~1.2.0", "grunt-contrib-less": "~2.1.0", "grunt-contrib-watch": "~1.1.0", - "grunt-eslint": "~20.2.0", + "grunt-eslint": "~23.0.0", "grunt-exec": "~3.0.0", "grunt-replace": "~2.0.2", "grunt-styledocco": "~0.3.0",