diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json
index b013f1445a..9fe1d22f7b 100644
--- a/core/.eslintrc.passing.json
+++ b/core/.eslintrc.passing.json
@@ -1,7 +1,6 @@
 {
   "extends": "./.eslintrc.json",
   "rules": {
-    "no-var": "off",
     "no-useless-escape": "off",
     "no-useless-concat": "off",
     "no-use-before-define": "off",
diff --git a/core/misc/autocomplete.es6.js b/core/misc/autocomplete.es6.js
index eeac77e5f7..9beaf02af3 100644
--- a/core/misc/autocomplete.es6.js
+++ b/core/misc/autocomplete.es6.js
@@ -136,7 +136,7 @@
     }
 
     // Get the desired term and construct the autocomplete URL for it.
-    var term = autocomplete.extractLastTerm(request.term);
+    const term = autocomplete.extractLastTerm(request.term);
 
     // Check if the term is already cached.
     if (autocomplete.cache[elementId].hasOwnProperty(term)) {
diff --git a/core/misc/tabledrag.es6.js b/core/misc/tabledrag.es6.js
index 9292f5017f..e660ffbb22 100644
--- a/core/misc/tabledrag.es6.js
+++ b/core/misc/tabledrag.es6.js
@@ -510,9 +510,9 @@
         // Up arrow.
         case 38:
         // Safari up arrow.
-        case 63232:
-          var $previousRow = $(self.rowObject.element).prev('tr:first-of-type');
-          var previousRow = $previousRow.get(0);
+        case 63232: {
+          let $previousRow = $(self.rowObject.element).prev('tr:first-of-type');
+          let previousRow = $previousRow.get(0);
           while (previousRow && $previousRow.is(':hidden')) {
             $previousRow = $(previousRow).prev('tr:first-of-type');
             previousRow = $previousRow.get(0);
@@ -549,7 +549,7 @@
             handle.trigger('focus');
           }
           break;
-
+        }
         // Right arrow.
         case 39:
         // Safari right arrow.
@@ -561,9 +561,9 @@
         // Down arrow.
         case 40:
         // Safari down arrow.
-        case 63233:
-          var $nextRow = $(self.rowObject.group).eq(-1).next('tr:first-of-type');
-          var nextRow = $nextRow.get(0);
+        case 63233: {
+          let $nextRow = $(self.rowObject.group).eq(-1).next('tr:first-of-type');
+          let nextRow = $nextRow.get(0);
           while (nextRow && $nextRow.is(':hidden')) {
             $nextRow = $(nextRow).next('tr:first-of-type');
             nextRow = $nextRow.get(0);
@@ -599,6 +599,7 @@
             handle.trigger('focus');
           }
           break;
+        }
       }
 
       /* eslint-enable no-fallthrough */
@@ -870,7 +871,7 @@
       let row = rows[n];
       let $row = $(row);
       const rowY = $row.offset().top;
-      var rowHeight;
+      let rowHeight;
       // Because Safari does not report offsetHeight on table rows, but does on
       // table cells, grab the firstChild of the row and use that instead.
       // http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari.
@@ -1037,8 +1038,8 @@
           targetElement.value = sourceElement.value;
           break;
 
-        case 'order':
-          var siblings = this.rowObject.findSiblings(rowSettings);
+        case 'order': {
+          const siblings = this.rowObject.findSiblings(rowSettings);
           if ($(targetElement).is('select')) {
             // Get a list of acceptable values.
             const values = [];
@@ -1067,6 +1068,7 @@
             });
           }
           break;
+        }
       }
     }
   };
diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js
index 3155c77e39..f460567248 100644
--- a/core/misc/tabledrag.js
+++ b/core/misc/tabledrag.js
@@ -289,39 +289,41 @@
 
         case 38:
         case 63232:
-          var $previousRow = $(self.rowObject.element).prev('tr:first-of-type');
-          var previousRow = $previousRow.get(0);
-          while (previousRow && $previousRow.is(':hidden')) {
-            $previousRow = $(previousRow).prev('tr:first-of-type');
-            previousRow = $previousRow.get(0);
-          }
-          if (previousRow) {
-            self.safeBlur = false;
-            self.rowObject.direction = 'up';
-            keyChange = true;
-
-            if ($(item).is('.tabledrag-root')) {
-              groupHeight = 0;
-              while (previousRow && $previousRow.find('.js-indentation').length) {
-                $previousRow = $(previousRow).prev('tr:first-of-type');
-                previousRow = $previousRow.get(0);
-                groupHeight += $previousRow.is(':hidden') ? 0 : previousRow.offsetHeight;
-              }
-              if (previousRow) {
-                self.rowObject.swap('before', previousRow);
+          {
+            var $previousRow = $(self.rowObject.element).prev('tr:first-of-type');
+            var previousRow = $previousRow.get(0);
+            while (previousRow && $previousRow.is(':hidden')) {
+              $previousRow = $(previousRow).prev('tr:first-of-type');
+              previousRow = $previousRow.get(0);
+            }
+            if (previousRow) {
+              self.safeBlur = false;
+              self.rowObject.direction = 'up';
+              keyChange = true;
+
+              if ($(item).is('.tabledrag-root')) {
+                groupHeight = 0;
+                while (previousRow && $previousRow.find('.js-indentation').length) {
+                  $previousRow = $(previousRow).prev('tr:first-of-type');
+                  previousRow = $previousRow.get(0);
+                  groupHeight += $previousRow.is(':hidden') ? 0 : previousRow.offsetHeight;
+                }
+                if (previousRow) {
+                  self.rowObject.swap('before', previousRow);
 
-                window.scrollBy(0, -groupHeight);
+                  window.scrollBy(0, -groupHeight);
+                }
+              } else if (self.table.tBodies[0].rows[0] !== previousRow || $previousRow.is('.draggable')) {
+                self.rowObject.swap('before', previousRow);
+                self.rowObject.interval = null;
+                self.rowObject.indent(0);
+                window.scrollBy(0, -parseInt(item.offsetHeight, 10));
               }
-            } else if (self.table.tBodies[0].rows[0] !== previousRow || $previousRow.is('.draggable')) {
-              self.rowObject.swap('before', previousRow);
-              self.rowObject.interval = null;
-              self.rowObject.indent(0);
-              window.scrollBy(0, -parseInt(item.offsetHeight, 10));
-            }
 
-            handle.trigger('focus');
+              handle.trigger('focus');
+            }
+            break;
           }
-          break;
 
         case 39:
         case 63235:
@@ -331,39 +333,41 @@
 
         case 40:
         case 63233:
-          var $nextRow = $(self.rowObject.group).eq(-1).next('tr:first-of-type');
-          var nextRow = $nextRow.get(0);
-          while (nextRow && $nextRow.is(':hidden')) {
-            $nextRow = $(nextRow).next('tr:first-of-type');
-            nextRow = $nextRow.get(0);
-          }
-          if (nextRow) {
-            self.safeBlur = false;
-            self.rowObject.direction = 'down';
-            keyChange = true;
-
-            if ($(item).is('.tabledrag-root')) {
-              groupHeight = 0;
-              var nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
-              if (nextGroup) {
-                $(nextGroup.group).each(function () {
-                  groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight;
-                });
-                var nextGroupRow = $(nextGroup.group).eq(-1).get(0);
-                self.rowObject.swap('after', nextGroupRow);
-
-                window.scrollBy(0, parseInt(groupHeight, 10));
-              }
-            } else {
-              self.rowObject.swap('after', nextRow);
-              self.rowObject.interval = null;
-              self.rowObject.indent(0);
-              window.scrollBy(0, parseInt(item.offsetHeight, 10));
+          {
+            var $nextRow = $(self.rowObject.group).eq(-1).next('tr:first-of-type');
+            var nextRow = $nextRow.get(0);
+            while (nextRow && $nextRow.is(':hidden')) {
+              $nextRow = $(nextRow).next('tr:first-of-type');
+              nextRow = $nextRow.get(0);
             }
+            if (nextRow) {
+              self.safeBlur = false;
+              self.rowObject.direction = 'down';
+              keyChange = true;
+
+              if ($(item).is('.tabledrag-root')) {
+                groupHeight = 0;
+                var nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
+                if (nextGroup) {
+                  $(nextGroup.group).each(function () {
+                    groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight;
+                  });
+                  var nextGroupRow = $(nextGroup.group).eq(-1).get(0);
+                  self.rowObject.swap('after', nextGroupRow);
+
+                  window.scrollBy(0, parseInt(groupHeight, 10));
+                }
+              } else {
+                self.rowObject.swap('after', nextRow);
+                self.rowObject.interval = null;
+                self.rowObject.indent(0);
+                window.scrollBy(0, parseInt(item.offsetHeight, 10));
+              }
 
-            handle.trigger('focus');
+              handle.trigger('focus');
+            }
+            break;
           }
-          break;
       }
 
       if (self.rowObject && self.rowObject.changed === true) {
@@ -539,7 +543,7 @@
       var row = rows[n];
       var $row = $(row);
       var rowY = $row.offset().top;
-      var rowHeight;
+      var rowHeight = void 0;
 
       if (row.offsetHeight === 0) {
         rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
@@ -658,29 +662,31 @@
           break;
 
         case 'order':
-          var siblings = this.rowObject.findSiblings(rowSettings);
-          if ($(targetElement).is('select')) {
-            var values = [];
-            $(targetElement).find('option').each(function () {
-              values.push(this.value);
-            });
-            var maxVal = values[values.length - 1];
-
-            $(siblings).find(targetClass).each(function () {
-              if (values.length > 0) {
-                this.value = values.shift();
-              } else {
-                this.value = maxVal;
-              }
-            });
-          } else {
-            var weight = parseInt($(siblings[0]).find(targetClass).val(), 10) || 0;
-            $(siblings).find(targetClass).each(function () {
-              this.value = weight;
-              weight++;
-            });
+          {
+            var siblings = this.rowObject.findSiblings(rowSettings);
+            if ($(targetElement).is('select')) {
+              var values = [];
+              $(targetElement).find('option').each(function () {
+                values.push(this.value);
+              });
+              var maxVal = values[values.length - 1];
+
+              $(siblings).find(targetClass).each(function () {
+                if (values.length > 0) {
+                  this.value = values.shift();
+                } else {
+                  this.value = maxVal;
+                }
+              });
+            } else {
+              var weight = parseInt($(siblings[0]).find(targetClass).val(), 10) || 0;
+              $(siblings).find(targetClass).each(function () {
+                this.value = weight;
+                weight++;
+              });
+            }
+            break;
           }
-          break;
       }
     }
   };
diff --git a/core/misc/tableselect.es6.js b/core/misc/tableselect.es6.js
index a92fdd5f17..a5b713fb36 100644
--- a/core/misc/tableselect.es6.js
+++ b/core/misc/tableselect.es6.js
@@ -129,12 +129,11 @@
 
     // Traverse through the sibling nodes.
     for (let i = from[mode]; i; i = i[mode]) {
-      var $i;
+      const $i = $(i);
       // Make sure that we're only dealing with elements.
       if (i.nodeType !== 1) {
         continue;
       }
-      $i = $(i);
       // Either add or remove the selected class based on the state of the
       // target checkbox.
       $i.toggleClass('selected', state);
diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js
index 677f72d334..388700dd77 100644
--- a/core/misc/tableselect.js
+++ b/core/misc/tableselect.js
@@ -74,12 +74,11 @@
     var mode = from.rowIndex > to.rowIndex ? 'previousSibling' : 'nextSibling';
 
     for (var i = from[mode]; i; i = i[mode]) {
-      var $i;
+      var $i = $(i);
 
       if (i.nodeType !== 1) {
         continue;
       }
-      $i = $(i);
 
       $i.toggleClass('selected', state);
       $i.find('input[type="checkbox"]').prop('checked', state);
diff --git a/core/modules/big_pipe/js/big_pipe.es6.js b/core/modules/big_pipe/js/big_pipe.es6.js
index a05fb0eb68..b78eaa9c70 100644
--- a/core/modules/big_pipe/js/big_pipe.es6.js
+++ b/core/modules/big_pipe/js/big_pipe.es6.js
@@ -89,7 +89,7 @@
   // The frequency with which to check for newly arrived BigPipe placeholders.
   // Hence 50 ms means we check 20 times per second. Setting this to 100 ms or
   // more would cause the user to see content appear noticeably slower.
-  var interval = drupalSettings.bigPipeInterval || 50;
+  const interval = drupalSettings.bigPipeInterval || 50;
   // The internal ID to contain the watcher service.
   let timeoutID;
 
diff --git a/core/modules/ckeditor/js/ckeditor.admin.es6.js b/core/modules/ckeditor/js/ckeditor.admin.es6.js
index 92e225caec..5a2828c43e 100644
--- a/core/modules/ckeditor/js/ckeditor.admin.es6.js
+++ b/core/modules/ckeditor/js/ckeditor.admin.es6.js
@@ -290,7 +290,7 @@
 
       // Create a Drupal dialog that will get a button group name from the user.
       const $ckeditorButtonGroupNameForm = $(Drupal.theme('ckeditorButtonGroupNameForm'));
-      var dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), {
+      const dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), {
         title: Drupal.t('Button group name'),
         dialogClass: 'ckeditor-name-toolbar-group',
         resizable: false,
diff --git a/core/modules/editor/js/editor.es6.js b/core/modules/editor/js/editor.es6.js
index 03c50d958c..a882368359 100644
--- a/core/modules/editor/js/editor.es6.js
+++ b/core/modules/editor/js/editor.es6.js
@@ -80,7 +80,7 @@
       const message = Drupal.t('Changing the text format to %text_format will permanently remove content that is not allowed in that text format.<br><br>Save your changes before switching the text format to avoid losing data.', {
         '%text_format': $select.find('option:selected').text(),
       });
-      var confirmationDialog = Drupal.dialog(`<div>${message}</div>`, {
+      const confirmationDialog = Drupal.dialog(`<div>${message}</div>`, {
         title: Drupal.t('Change text format?'),
         dialogClass: 'editor-change-text-format-modal',
         resizable: false,
diff --git a/core/modules/editor/js/editor.formattedTextEditor.es6.js b/core/modules/editor/js/editor.formattedTextEditor.es6.js
index 3005a38712..1da8d6f0d1 100644
--- a/core/modules/editor/js/editor.formattedTextEditor.es6.js
+++ b/core/modules/editor/js/editor.formattedTextEditor.es6.js
@@ -140,9 +140,9 @@
           }
           break;
 
-        case 'active':
-          var textElement = this.$textElement.get(0);
-          var toolbarView = fieldModel.toolbarView;
+        case 'active': {
+          const textElement = this.$textElement.get(0);
+          const toolbarView = fieldModel.toolbarView;
           this.textEditor.attachInlineEditor(
             textElement,
             this.textFormat,
@@ -155,6 +155,7 @@
             fieldModel.set('state', 'changed');
           });
           break;
+        }
 
         case 'changed':
           break;
diff --git a/core/modules/editor/js/editor.formattedTextEditor.js b/core/modules/editor/js/editor.formattedTextEditor.js
index 299b60a729..3d74aaba05 100644
--- a/core/modules/editor/js/editor.formattedTextEditor.js
+++ b/core/modules/editor/js/editor.formattedTextEditor.js
@@ -73,15 +73,17 @@
           break;
 
         case 'active':
-          var textElement = this.$textElement.get(0);
-          var toolbarView = fieldModel.toolbarView;
-          this.textEditor.attachInlineEditor(textElement, this.textFormat, toolbarView.getMainWysiwygToolgroupId(), toolbarView.getFloatedWysiwygToolgroupId());
-
-          this.textEditor.onChange(textElement, function (htmlText) {
-            editorModel.set('currentValue', htmlText);
-            fieldModel.set('state', 'changed');
-          });
-          break;
+          {
+            var textElement = this.$textElement.get(0);
+            var toolbarView = fieldModel.toolbarView;
+            this.textEditor.attachInlineEditor(textElement, this.textFormat, toolbarView.getMainWysiwygToolgroupId(), toolbarView.getFloatedWysiwygToolgroupId());
+
+            this.textEditor.onChange(textElement, function (htmlText) {
+              editorModel.set('currentValue', htmlText);
+              fieldModel.set('state', 'changed');
+            });
+            break;
+          }
 
         case 'changed':
           break;
diff --git a/core/modules/image/js/editors/image.es6.js b/core/modules/image/js/editors/image.es6.js
index fe0e6f56d6..3621ff97ac 100644
--- a/core/modules/image/js/editors/image.es6.js
+++ b/core/modules/image/js/editors/image.es6.js
@@ -70,15 +70,15 @@
           });
           break;
 
-        case 'active':
-          var self = this;
+        case 'active': {
+          const self = this;
 
           // Indicate that this element is being edited by Quick Edit Image.
           this.$el.addClass('quickedit-image-element');
 
           // Render our initial dropzone element. Once the user reverts changes
           // or saves a new image, this element is removed.
-          var $dropzone = this.renderDropzone('upload', Drupal.t('Drop file here or click to upload'));
+          const $dropzone = this.renderDropzone('upload', Drupal.t('Drop file here or click to upload'));
 
           $dropzone.on('dragenter', function (e) {
             $(this).addClass('hover');
@@ -117,6 +117,7 @@
 
           this.renderToolbar(fieldModel);
           break;
+        }
 
         case 'changed':
           break;
diff --git a/core/modules/image/js/editors/image.js b/core/modules/image/js/editors/image.js
index 7075b49b59..95646cd764 100644
--- a/core/modules/image/js/editors/image.js
+++ b/core/modules/image/js/editors/image.js
@@ -50,41 +50,43 @@
           break;
 
         case 'active':
-          var self = this;
+          {
+            var self = this;
 
-          this.$el.addClass('quickedit-image-element');
+            this.$el.addClass('quickedit-image-element');
 
-          var $dropzone = this.renderDropzone('upload', Drupal.t('Drop file here or click to upload'));
+            var $dropzone = this.renderDropzone('upload', Drupal.t('Drop file here or click to upload'));
 
-          $dropzone.on('dragenter', function (e) {
-            $(this).addClass('hover');
-          });
-          $dropzone.on('dragleave', function (e) {
-            $(this).removeClass('hover');
-          });
-
-          $dropzone.on('drop', function (e) {
-            if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files.length) {
+            $dropzone.on('dragenter', function (e) {
+              $(this).addClass('hover');
+            });
+            $dropzone.on('dragleave', function (e) {
               $(this).removeClass('hover');
-              self.uploadImage(e.originalEvent.dataTransfer.files[0]);
-            }
-          });
+            });
 
-          $dropzone.on('click', function (e) {
-            $('<input type="file">').trigger('click').on('change', function () {
-              if (this.files.length) {
-                self.uploadImage(this.files[0]);
+            $dropzone.on('drop', function (e) {
+              if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files.length) {
+                $(this).removeClass('hover');
+                self.uploadImage(e.originalEvent.dataTransfer.files[0]);
               }
             });
-          });
 
-          $dropzone.on('dragover dragenter dragleave drop click', function (e) {
-            e.preventDefault();
-            e.stopPropagation();
-          });
+            $dropzone.on('click', function (e) {
+              $('<input type="file">').trigger('click').on('change', function () {
+                if (this.files.length) {
+                  self.uploadImage(this.files[0]);
+                }
+              });
+            });
 
-          this.renderToolbar(fieldModel);
-          break;
+            $dropzone.on('dragover dragenter dragleave drop click', function (e) {
+              e.preventDefault();
+              e.stopPropagation();
+            });
+
+            this.renderToolbar(fieldModel);
+            break;
+          }
 
         case 'changed':
           break;
diff --git a/core/modules/quickedit/js/editors/formEditor.es6.js b/core/modules/quickedit/js/editors/formEditor.es6.js
index 7864f67c6f..1950b47bba 100644
--- a/core/modules/quickedit/js/editors/formEditor.es6.js
+++ b/core/modules/quickedit/js/editors/formEditor.es6.js
@@ -194,7 +194,7 @@
       }
 
       // Create an AJAX object for the form associated with the field.
-      var formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving({
+      let formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving({
         nocssjs: false,
         other_view_modes: fieldModel.findOtherViewModes(),
       }, $submit);
diff --git a/core/modules/quickedit/js/models/EntityModel.es6.js b/core/modules/quickedit/js/models/EntityModel.es6.js
index 7c36e362bb..4ea8371356 100644
--- a/core/modules/quickedit/js/models/EntityModel.es6.js
+++ b/core/modules/quickedit/js/models/EntityModel.es6.js
@@ -189,9 +189,9 @@
           this.set('isActive', true);
           break;
 
-        case 'committing':
+        case 'committing': {
           // The user indicated they want to save the entity.
-          var fields = this.get('fields');
+          const fields = this.get('fields');
           // For fields that are in an active state, transition them to
           // candidate.
           fields.chain()
@@ -207,9 +207,10 @@
               fieldModel.set('state', 'saving');
             });
           break;
+        }
 
-        case 'deactivating':
-          var changedFields = this.get('fields')
+        case 'deactivating': {
+          const changedFields = this.get('fields')
             .filter(fieldModel => _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length);
           // If the entity contains unconfirmed or unsaved changes, return the
           // entity to an opened state and ask the user if they would like to
@@ -250,6 +251,7 @@
             });
           }
           break;
+        }
 
         case 'closing':
           // Set all fields to the 'inactive' state.
@@ -364,7 +366,7 @@
           }
           break;
 
-        case 'committing':
+        case 'committing': {
           // If the field save returned a validation error, set the state of the
           // entity back to 'opened'.
           if (fieldState === 'invalid') {
@@ -380,7 +382,7 @@
 
           // Attempt to save the entity. If the entity's fields are not yet all
           // in a ready state, the save will not be processed.
-          var options = {
+          const options = {
             'accept-field-states': Drupal.quickedit.app.readyFieldStates,
           };
           if (entityModel.set('isCommitting', true, options)) {
@@ -404,6 +406,7 @@
             });
           }
           break;
+        }
 
         case 'deactivating':
           // When setting the entity to 'closing', require that all fieldModels
diff --git a/core/modules/quickedit/js/models/EntityModel.js b/core/modules/quickedit/js/models/EntityModel.js
index cf84a515aa..3c55c6ab41 100644
--- a/core/modules/quickedit/js/models/EntityModel.js
+++ b/core/modules/quickedit/js/models/EntityModel.js
@@ -69,48 +69,52 @@
           break;
 
         case 'committing':
-          var fields = this.get('fields');
+          {
+            var fields = this.get('fields');
 
-          fields.chain().filter(function (fieldModel) {
-            return _.intersection([fieldModel.get('state')], ['active']).length;
-          }).each(function (fieldModel) {
-            fieldModel.set('state', 'candidate');
-          });
+            fields.chain().filter(function (fieldModel) {
+              return _.intersection([fieldModel.get('state')], ['active']).length;
+            }).each(function (fieldModel) {
+              fieldModel.set('state', 'candidate');
+            });
 
-          fields.chain().filter(function (fieldModel) {
-            return _.intersection([fieldModel.get('state')], Drupal.quickedit.app.changedFieldStates).length;
-          }).each(function (fieldModel) {
-            fieldModel.set('state', 'saving');
-          });
-          break;
+            fields.chain().filter(function (fieldModel) {
+              return _.intersection([fieldModel.get('state')], Drupal.quickedit.app.changedFieldStates).length;
+            }).each(function (fieldModel) {
+              fieldModel.set('state', 'saving');
+            });
+            break;
+          }
 
         case 'deactivating':
-          var changedFields = this.get('fields').filter(function (fieldModel) {
-            return _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length;
-          });
-
-          if ((changedFields.length || this.get('fieldsInTempStore').length) && !options.saved && !options.confirmed) {
-            this.set('state', 'opened', { confirming: true });
-
-            _.defer(function () {
-              Drupal.quickedit.app.confirmEntityDeactivation(entityModel);
+          {
+            var changedFields = this.get('fields').filter(function (fieldModel) {
+              return _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length;
             });
-          } else {
-            var invalidFields = this.get('fields').filter(function (fieldModel) {
-              return _.intersection([fieldModel.get('state')], ['invalid']).length;
-            });
-
-            entityModel.set('reload', this.get('fieldsInTempStore').length || invalidFields.length);
 
-            entityModel.get('fields').each(function (fieldModel) {
-              if (_.intersection([fieldModel.get('state')], ['candidate', 'highlighted']).length) {
-                fieldModel.trigger('change:state', fieldModel, fieldModel.get('state'), options);
-              } else {
-                fieldModel.set('state', 'candidate', options);
-              }
-            });
+            if ((changedFields.length || this.get('fieldsInTempStore').length) && !options.saved && !options.confirmed) {
+              this.set('state', 'opened', { confirming: true });
+
+              _.defer(function () {
+                Drupal.quickedit.app.confirmEntityDeactivation(entityModel);
+              });
+            } else {
+              var invalidFields = this.get('fields').filter(function (fieldModel) {
+                return _.intersection([fieldModel.get('state')], ['invalid']).length;
+              });
+
+              entityModel.set('reload', this.get('fieldsInTempStore').length || invalidFields.length);
+
+              entityModel.get('fields').each(function (fieldModel) {
+                if (_.intersection([fieldModel.get('state')], ['candidate', 'highlighted']).length) {
+                  fieldModel.trigger('change:state', fieldModel, fieldModel.get('state'), options);
+                } else {
+                  fieldModel.set('state', 'candidate', options);
+                }
+              });
+            }
+            break;
           }
-          break;
 
         case 'closing':
           options.reason = 'stop';
@@ -166,36 +170,38 @@
           break;
 
         case 'committing':
-          if (fieldState === 'invalid') {
-            _.defer(function () {
-              entityModel.set('state', 'opened', { reason: 'invalid' });
-            });
-          } else {
-            this._updateInTempStoreAttributes(entityModel, fieldModel);
-          }
-
-          var options = {
-            'accept-field-states': Drupal.quickedit.app.readyFieldStates
-          };
-          if (entityModel.set('isCommitting', true, options)) {
-            entityModel.save({
-              success: function success() {
-                entityModel.set({
-                  state: 'deactivating',
-                  isCommitting: false
-                }, { saved: true });
-              },
-              error: function error() {
-                entityModel.set('isCommitting', false);
-
-                entityModel.set('state', 'opened', { reason: 'networkerror' });
-
-                var message = Drupal.t('Your changes to <q>@entity-title</q> could not be saved, either due to a website problem or a network connection problem.<br>Please try again.', { '@entity-title': entityModel.get('label') });
-                Drupal.quickedit.util.networkErrorModal(Drupal.t('Network problem!'), message);
-              }
-            });
+          {
+            if (fieldState === 'invalid') {
+              _.defer(function () {
+                entityModel.set('state', 'opened', { reason: 'invalid' });
+              });
+            } else {
+              this._updateInTempStoreAttributes(entityModel, fieldModel);
+            }
+
+            var options = {
+              'accept-field-states': Drupal.quickedit.app.readyFieldStates
+            };
+            if (entityModel.set('isCommitting', true, options)) {
+              entityModel.save({
+                success: function success() {
+                  entityModel.set({
+                    state: 'deactivating',
+                    isCommitting: false
+                  }, { saved: true });
+                },
+                error: function error() {
+                  entityModel.set('isCommitting', false);
+
+                  entityModel.set('state', 'opened', { reason: 'networkerror' });
+
+                  var message = Drupal.t('Your changes to <q>@entity-title</q> could not be saved, either due to a website problem or a network connection problem.<br>Please try again.', { '@entity-title': entityModel.get('label') });
+                  Drupal.quickedit.util.networkErrorModal(Drupal.t('Network problem!'), message);
+                }
+              });
+            }
+            break;
           }
-          break;
 
         case 'deactivating':
           _.defer(function () {
diff --git a/core/modules/quickedit/js/util.es6.js b/core/modules/quickedit/js/util.es6.js
index 7fa952be5c..f8873e2e35 100644
--- a/core/modules/quickedit/js/util.es6.js
+++ b/core/modules/quickedit/js/util.es6.js
@@ -58,7 +58,7 @@
    */
   Drupal.quickedit.util.networkErrorModal = function (title, message) {
     const $message = $(`<div>${message}</div>`);
-    var networkErrorModal = Drupal.dialog($message.get(0), {
+    const networkErrorModal = Drupal.dialog($message.get(0), {
       title,
       dialogClass: 'quickedit-network-error',
       buttons: [
diff --git a/core/modules/quickedit/js/views/EditorView.es6.js b/core/modules/quickedit/js/views/EditorView.es6.js
index 7eff43e42a..12908943ad 100644
--- a/core/modules/quickedit/js/views/EditorView.es6.js
+++ b/core/modules/quickedit/js/views/EditorView.es6.js
@@ -118,13 +118,13 @@
           // visible yet.
           break;
 
-        case 'activating':
+        case 'activating': {
           // The user has indicated he wants to do in-place editing: if
           // something needs to be loaded (CSS/JavaScript/server data/…), then
           // do so at this stage, and once the in-place editor is ready,
           // set the 'active' state. A "loading" indicator will be shown in the
           // UI for as long as the field remains in this state.
-          var loadDependencies = function (callback) {
+          const loadDependencies = function (callback) {
             // Do the loading here.
             callback();
           };
@@ -132,6 +132,7 @@
             fieldModel.set('state', 'active');
           });
           break;
+        }
 
         case 'active':
           // The user can now actually use the in-place editor.
diff --git a/core/modules/quickedit/js/views/EditorView.js b/core/modules/quickedit/js/views/EditorView.js
index ad5c131777..a4b05f45ea 100644
--- a/core/modules/quickedit/js/views/EditorView.js
+++ b/core/modules/quickedit/js/views/EditorView.js
@@ -38,13 +38,15 @@
           break;
 
         case 'activating':
-          var loadDependencies = function loadDependencies(callback) {
-            callback();
-          };
-          loadDependencies(function () {
-            fieldModel.set('state', 'active');
-          });
-          break;
+          {
+            var loadDependencies = function loadDependencies(callback) {
+              callback();
+            };
+            loadDependencies(function () {
+              fieldModel.set('state', 'active');
+            });
+            break;
+          }
 
         case 'active':
           break;
diff --git a/core/modules/quickedit/js/views/EntityToolbarView.es6.js b/core/modules/quickedit/js/views/EntityToolbarView.es6.js
index 4c87d087e4..7557ed7f17 100644
--- a/core/modules/quickedit/js/views/EntityToolbarView.es6.js
+++ b/core/modules/quickedit/js/views/EntityToolbarView.es6.js
@@ -230,10 +230,10 @@
             delay = 250;
             break;
 
-          default:
-            var fieldModels = this.model.get('fields').models;
-            var topMostPosition = 1000000;
-            var topMostField = null;
+          default: {
+            const fieldModels = this.model.get('fields').models;
+            let topMostPosition = 1000000;
+            let topMostField = null;
             // Position against the topmost field.
             for (let i = 0; i < fieldModels.length; i++) {
               const pos = fieldModels[i].get('el').getBoundingClientRect().top;
@@ -245,6 +245,7 @@
             of = topMostField.get('el');
             delay = 50;
             break;
+          }
         }
         // Prepare to check the next possible element to position against.
         check++;
diff --git a/core/modules/quickedit/js/views/EntityToolbarView.js b/core/modules/quickedit/js/views/EntityToolbarView.js
index bc5ab75db9..8b919b10e6 100644
--- a/core/modules/quickedit/js/views/EntityToolbarView.js
+++ b/core/modules/quickedit/js/views/EntityToolbarView.js
@@ -142,20 +142,22 @@
             break;
 
           default:
-            var fieldModels = this.model.get('fields').models;
-            var topMostPosition = 1000000;
-            var topMostField = null;
-
-            for (var i = 0; i < fieldModels.length; i++) {
-              var pos = fieldModels[i].get('el').getBoundingClientRect().top;
-              if (pos < topMostPosition) {
-                topMostPosition = pos;
-                topMostField = fieldModels[i];
+            {
+              var fieldModels = this.model.get('fields').models;
+              var topMostPosition = 1000000;
+              var topMostField = null;
+
+              for (var i = 0; i < fieldModels.length; i++) {
+                var pos = fieldModels[i].get('el').getBoundingClientRect().top;
+                if (pos < topMostPosition) {
+                  topMostPosition = pos;
+                  topMostField = fieldModels[i];
+                }
               }
+              of = topMostField.get('el');
+              delay = 50;
+              break;
             }
-            of = topMostField.get('el');
-            delay = 50;
-            break;
         }
 
         check++;
diff --git a/core/themes/seven/js/responsive-details.es6.js b/core/themes/seven/js/responsive-details.es6.js
index d3cf6ccb3e..8d5c46565a 100644
--- a/core/themes/seven/js/responsive-details.es6.js
+++ b/core/themes/seven/js/responsive-details.es6.js
@@ -43,7 +43,7 @@
         detailsToggle(event.matches);
       }
 
-      var $summaries = $details.find('> summary');
+      const $summaries = $details.find('> summary');
       const mql = window.matchMedia('(min-width:48em)');
       mql.addListener(handleDetailsMQ);
       detailsToggle(mql.matches);
