[gnome-shell-extensions/wip/fmuellner/lint-ci: 7/17] lint: Allow single-line braces



commit 8b792058fa7ebfb58446c630a011af6ace9894af
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jan 28 01:42:00 2019 +0100

    lint: Allow single-line braces
    
    When using arrow functions, we only omit the braces when we are using
    the return value:
    
        this.get_children().filter(w => w.visible);
    
    When braces are used, eslint by default enforces line breaks, but
    there are cases where the expression is hardly less concise than
    the above:
    
        this.get_children().forEach(w => { w.destroy(); });
    
    So change the default to allow this.

 lint/eslintrc-shell.json | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json
index c02c6ca..cce7a32 100644
--- a/lint/eslintrc-shell.json
+++ b/lint/eslintrc-shell.json
@@ -1,6 +1,13 @@
 {
     "rules": {
         "arrow-spacing": "error",
+        "brace-style": [
+            "error",
+            "1tbs",
+            {
+                "allowSingleLine": true
+            }
+        ],
         "camelcase": [
             "error",
             {


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