[gnome-shell-extensions/wip/fmuellner/lint-ci: 8/17] lint: Tweak indenting rule



commit 4ade98f19985d4e1410ae5ae05141b0d8947220e
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jan 28 01:42:59 2019 +0100

    lint: Tweak indenting rule
    
    I simply cannot deal with multi-line trinary expressions where the
    two "branches" don't align, so add an exception for them.
    
    And while the strict 4-line indent for objects is growing on me for
    "regular" objects:
    
        let foo = new Foo({
            bar: 42,
            baz: 'bam'
        });
    
    I do prefer the current style of compact braces and aligned properties
    for object lists:
    
        let entries = [
            { name: 'foo',
              visible: true },
            { name: 'bar',
              halign: Gtk.Align.START }
        ];
    
    So allow the latter style as well, at least for the time being.

 lint/eslintrc-shell.json | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json
index cce7a32..063a73f 100644
--- a/lint/eslintrc-shell.json
+++ b/lint/eslintrc-shell.json
@@ -15,6 +15,17 @@
                 "allow": ["^vfunc_"]
             }
         ],
+        "indent": [
+            "error",
+            4,
+            {
+                "ignoredNodes": [
+                    "ArrayExpression > ObjectExpression",
+                    "ConditionalExpression"
+                ],
+                "MemberExpression": "off"
+            }
+        ],
         "key-spacing": [
             "error",
             {


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