[gnome-shell] style: Avoid trailing commas in array destructuring



commit 55235c2552dacca02ddb2efd8b0b6f99f8840156
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jan 29 20:20:09 2019 +0100

    style: Avoid trailing commas in array destructuring
    
    When destructuring multiple return values, we often use trailing commas
    to indicate that there are additional elements that we are ignoring.
    
    There isn't anything inherently wrong with that, but it's a style that's
    too confusing for eslint - on the one hand we require a space after a
    comma, on the other hand we require no space before closing brackets.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

 js/ui/dash.js             | 4 ++--
 js/ui/iconGrid.js         | 4 ++--
 js/ui/overviewControls.js | 2 +-
 js/ui/status/keyboard.js  | 4 ++--
 js/ui/switcherPopup.js    | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 878045410..f010a52ae 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -321,8 +321,8 @@ class DashActor extends St.Widget {
         let themeNode = this.get_theme_node();
         let adjustedForWidth = themeNode.adjust_for_width(forWidth);
         let [, showAppsButton] = this.get_children();
-        let [minHeight, ] = showAppsButton.get_preferred_height(adjustedForWidth);
-        [minHeight, ] = themeNode.adjust_preferred_height(minHeight, natHeight);
+        let [minHeight] = showAppsButton.get_preferred_height(adjustedForWidth);
+        [minHeight] = themeNode.adjust_preferred_height(minHeight, natHeight);
 
         return [minHeight, natHeight];
     }
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 8e5c9c60a..22732f9a1 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -276,7 +276,7 @@ var IconGrid = GObject.registerClass({
         if (forWidth < 0)
             nColumns = children.length;
         else
-            [nColumns, ] = this._computeLayout(forWidth);
+            [nColumns] = this._computeLayout(forWidth);
 
         let nRows;
         if (nColumns > 0)
@@ -504,7 +504,7 @@ var IconGrid = GObject.registerClass({
             this._clonesAnimating.push(actorClone);
             Main.uiGroup.add_actor(actorClone);
 
-            let [width, height,,] = this._getAllocatedChildSizeAndSpacing(actor);
+            let [width, height] = this._getAllocatedChildSizeAndSpacing(actor);
             actorClone.set_size(width, height);
             let scaleX = sourceScaledWidth / width;
             let scaleY = sourceScaledHeight / height;
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index f10ba7306..a58d63524 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -133,7 +133,7 @@ var SlidingControl = class {
 
     getVisibleWidth() {
         let child = this.actor.get_first_child();
-        let [, , natWidth, ] = child.get_preferred_size();
+        let [, , natWidth] = child.get_preferred_size();
         return natWidth;
     }
 
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 8215a5549..00c3bed9c 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -539,7 +539,7 @@ var InputSourceManager = class {
             let exists = false;
 
             if (type == INPUT_SOURCE_TYPE_XKB) {
-                [exists, displayName, shortName, , ] =
+                [exists, displayName, shortName] =
                     this._xkbInfo.get_layout_info(id);
             } else if (type == INPUT_SOURCE_TYPE_IBUS) {
                 if (this._disableIBus)
@@ -564,7 +564,7 @@ var InputSourceManager = class {
         if (infosList.length == 0) {
             let type = INPUT_SOURCE_TYPE_XKB;
             let id = KeyboardManager.DEFAULT_LAYOUT;
-            let [ , displayName, shortName, , ] = this._xkbInfo.get_layout_info(id);
+            let [ , displayName, shortName] = this._xkbInfo.get_layout_info(id);
             infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
         }
 
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index 50a926e29..86ae768f1 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -525,8 +525,8 @@ var SwitcherList = GObject.registerClass({
 
     vfunc_get_preferred_width(forHeight) {
         let themeNode = this.get_theme_node();
-        let [maxChildMin, ] = this._maxChildWidth(forHeight);
-        let [minListWidth, ] = this._list.get_preferred_width(forHeight);
+        let [maxChildMin] = this._maxChildWidth(forHeight);
+        let [minListWidth] = this._list.get_preferred_width(forHeight);
 
         return themeNode.adjust_preferred_width(maxChildMin, minListWidth);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]