[gnome-shell-extensions/wip/fmuellner/more-style-changes: 3/7] style: Don't exempt ternary expressions from indent rule



commit 9b25a227c62e92f93b913502f3abe2aad78ec78f
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 28 18:26:39 2019 +0100

    style: Don't exempt ternary expressions from indent rule
    
    It turns out we can comply with gjs' coding style and still align the
    branches if line breaks are required, so do that to reduce diversion
    from the canonical GNOME style.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/57

 extensions/apps-menu/extension.js   | 10 +++++-----
 extensions/window-list/extension.js |  8 ++++----
 lint/eslintrc-legacy.json           |  1 -
 lint/eslintrc-shell.json            |  3 +--
 4 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 171b788..fb335cc 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -470,12 +470,12 @@ class ApplicationsButton extends PanelMenu.Button {
         this._tree.disconnect(this._treeChangedId);
         this._tree = null;
 
+        let handler = Main.sessionMode.hasOverview ?
+            Main.overview.toggle.bind(Main.overview) : null;
         Main.wm.setCustomKeybindingHandler('panel-main-menu',
                                            Shell.ActionMode.NORMAL |
                                            Shell.ActionMode.OVERVIEW,
-                                           Main.sessionMode.hasOverview ?
-                                           Main.overview.toggle.bind(Main.overview) :
-                                           null);
+                                           handler);
 
         this._desktopTarget.destroy();
     }
@@ -491,8 +491,8 @@ class ApplicationsButton extends PanelMenu.Button {
     _onMenuKeyPress(actor, event) {
         let symbol = event.get_key_symbol();
         if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) {
-            let direction = symbol == Clutter.KEY_Left ? Gtk.DirectionType.LEFT
-                                                       : Gtk.DirectionType.RIGHT;
+            let direction = symbol == Clutter.KEY_Left ?
+                Gtk.DirectionType.LEFT : Gtk.DirectionType.RIGHT;
             if (this.menu.actor.navigate_focus(global.stage.key_focus, direction, false))
                 return true;
         }
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index cb2edb0..493970a 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -116,15 +116,15 @@ class WindowContextMenu extends PopupMenu.PopupMenu {
     }
 
     _updateMinimizeItem() {
-        this._minimizeItem.label.text = this._metaWindow.minimized ? _("Unminimize")
-                                                                   : _("Minimize");
+        this._minimizeItem.label.text = this._metaWindow.minimized ?
+            _("Unminimize") : _("Minimize");
     }
 
     _updateMaximizeItem() {
         let maximized = this._metaWindow.maximized_vertically &&
                         this._metaWindow.maximized_horizontally;
-        this._maximizeItem.label.text = maximized ? _("Unmaximize")
-                                                  : _("Maximize");
+        this._maximizeItem.label.text = maximized ?
+            _("Unmaximize") : _("Maximize");
     }
 
     _onDestroy() {
diff --git a/lint/eslintrc-legacy.json b/lint/eslintrc-legacy.json
index 0bbbff1..e4b2fb0 100644
--- a/lint/eslintrc-legacy.json
+++ b/lint/eslintrc-legacy.json
@@ -5,7 +5,6 @@
             4,
             {
                 "ignoredNodes": [
-                    "ConditionalExpression",
                     "CallExpression > ArrowFunctionExpression",
                     "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > 
ClassExpression:first-child"
                 ],
diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json
index 1c60258..9821bf4 100644
--- a/lint/eslintrc-shell.json
+++ b/lint/eslintrc-shell.json
@@ -20,8 +20,7 @@
             4,
             {
                 "ignoredNodes": [
-                    "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > 
ClassExpression:first-child",
-                    "ConditionalExpression"
+                    "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > 
ClassExpression:first-child"
                 ],
                 "MemberExpression": "off"
             }


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