diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json index 6cd07bad56ac4caf521f4210b7ff5423ddb80a53..104286667ab07b760cd94fd82d90b93262dde12f 100644 --- a/core/.eslintrc.passing.json +++ b/core/.eslintrc.passing.json @@ -8,7 +8,6 @@ "no-restricted-syntax": "off", "no-new": "off", "no-multi-assign": "off", - "no-mixed-operators": "off", "no-empty": "off", "no-continue": "off", "new-cap": "off", diff --git a/core/misc/tabledrag.es6.js b/core/misc/tabledrag.es6.js index eeabb4714f646b54d461c13781f8daaf9e5fa908..ce621da43d08197e1a899f3680400fb500a6cc88 100644 --- a/core/misc/tabledrag.es6.js +++ b/core/misc/tabledrag.es6.js @@ -713,7 +713,8 @@ // Stop any current scrolling. clearInterval(self.scrollInterval); // Continue scrolling if the mouse has moved in the scroll direction. - if (scrollAmount > 0 && self.rowObject.direction === 'down' || scrollAmount < 0 && self.rowObject.direction === 'up') { + if ((scrollAmount > 0 && self.rowObject.direction === 'down') + || (scrollAmount < 0 && self.rowObject.direction === 'up')) { self.setScroll(scrollAmount); } @@ -827,8 +828,8 @@ return { x: event.pageX, y: event.pageY }; } return { - x: event.clientX + document.body.scrollLeft - document.body.clientLeft, - y: event.clientY + document.body.scrollTop - document.body.clientTop, + x: (event.clientX + document.body.scrollLeft) - document.body.clientLeft, + y: (event.clientY + document.body.scrollTop) - document.body.clientTop, }; }; @@ -1119,7 +1120,7 @@ // Return a scroll speed relative to the edge of the screen. if (cursorY - scrollY > windowHeight - trigger) { - delta = trigger / (windowHeight + scrollY - cursorY); + delta = trigger / ((windowHeight + scrollY) - cursorY); delta = (delta > 0 && delta < trigger) ? delta : trigger; return delta * this.scrollSettings.amount; } @@ -1144,7 +1145,8 @@ self.checkScroll(self.currentPointerCoords.y); const aboveTable = self.scrollY > self.table.topY; const belowTable = self.scrollY + self.windowHeight < self.table.bottomY; - if (scrollAmount > 0 && belowTable || scrollAmount < 0 && aboveTable) { + if ((scrollAmount > 0 && belowTable) + || (scrollAmount < 0 && aboveTable)) { window.scrollBy(0, scrollAmount); } }, this.scrollSettings.interval); diff --git a/core/modules/block/js/block.admin.es6.js b/core/modules/block/js/block.admin.es6.js index 77c65c373185660f3395e744fc3ce5c4246f23dc..86a3e366d653ee555ccacee8d0e10c004f5186e5 100644 --- a/core/modules/block/js/block.admin.es6.js +++ b/core/modules/block/js/block.admin.es6.js @@ -91,7 +91,7 @@ // Just scrolling the document.body will not work in Firefox. The html // element is needed as well. $('html, body').animate({ - scrollTop: $('.js-block-placed').offset().top - $container.offset().top + $container.scrollTop(), + scrollTop: ($('.js-block-placed').offset().top - $container.offset().top) + $container.scrollTop(), }, 500); }); } diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js index 9a6eb071e45b5cdda5c635845e7399891b34681f..5a514e564ca24f3a059e04841baba35318fee420 100644 --- a/core/modules/color/color.es6.js +++ b/core/modules/color/color.es6.js @@ -124,7 +124,7 @@ given[1] /= d; } else { - given[1] = 1 - (1 - given[1]) * d; + given[1] = 1 - ((1 - given[1]) * d); } } @@ -138,7 +138,7 @@ given[2] /= d; } else { - given[2] = 1 - (1 - given[2]) * d; + given[2] = 1 - ((1 - given[2]) * d); } } diff --git a/core/modules/history/js/history.es6.js b/core/modules/history/js/history.es6.js index 53a1d05f25e7e11ecb995a9755c62e46d3d50b7d..c34a4adcee8b99a75c762b500b3ec71e2ab14305 100644 --- a/core/modules/history/js/history.es6.js +++ b/core/modules/history/js/history.es6.js @@ -10,7 +10,8 @@ // Any comment that is older than 30 days is automatically considered read, // so for these we don't need to perform a request at all! - const thirtyDaysAgo = Math.round(new Date().getTime() / 1000) - 30 * 24 * 60 * 60; + const secondsIn30Days = 2592000; + const thirtyDaysAgo = Math.round(new Date().getTime() / 1000) - secondsIn30Days; // Use the data embedded in the page, if available. let embeddedLastReadTimestamps = false; diff --git a/core/modules/history/js/history.js b/core/modules/history/js/history.js index aa5ca78a8b15af4e92be6a65bbe14989def8503f..6dbd15cb99bfbe147f1758efd984b4f6f7151f31 100644 --- a/core/modules/history/js/history.js +++ b/core/modules/history/js/history.js @@ -8,7 +8,8 @@ (function ($, Drupal, drupalSettings, storage) { var currentUserID = parseInt(drupalSettings.user.uid, 10); - var thirtyDaysAgo = Math.round(new Date().getTime() / 1000) - 30 * 24 * 60 * 60; + var secondsIn30Days = 2592000; + var thirtyDaysAgo = Math.round(new Date().getTime() / 1000) - secondsIn30Days; var embeddedLastReadTimestamps = false; if (drupalSettings.history && drupalSettings.history.lastReadTimestamps) { diff --git a/core/modules/quickedit/js/views/EntityToolbarView.es6.js b/core/modules/quickedit/js/views/EntityToolbarView.es6.js index 7557ed7f179d443862cae4551ce3ee2c2d16e2f6..9975ff353569da83c387c3306c94266f84f32433 100644 --- a/core/modules/quickedit/js/views/EntityToolbarView.es6.js +++ b/core/modules/quickedit/js/views/EntityToolbarView.es6.js @@ -296,7 +296,7 @@ suggested.top = fenceTop; } else if ((suggested.top + toolbarHeight) > (fenceTop + fenceHeight)) { - suggested.top = fenceTop + fenceHeight - toolbarHeight; + suggested.top = (fenceTop + fenceHeight) - toolbarHeight; } // Position the toolbar. info.element.element.css({