[gnome-shell-extensions/wip/fmuellner/lint-ci: 1/18] lint: Import eslint rules from gjs



commit 1d96f83362a5520e4144830f4f44962a92183acd
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Jan 27 00:15:39 2019 +0100

    lint: Import eslint rules from gjs
    
    gjs started to run eslint during its CI a while ago, so there is an
    existing rules set we can use as a starting point for our own setup.
    
    As we will adapt those rules to our code base, we don't want those
    changes to make it harder to synchronize the copy with future gjs
    changes, so include the rules from a separate file rather than using
    the configuration directly.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50

 .eslintrc.json         |   5 +++
 lint/eslintrc-gjs.json | 113 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+)
---
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..255b0f2
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+    "extends": [
+        "./lint/eslintrc-gjs.json"
+    ]
+}
diff --git a/lint/eslintrc-gjs.json b/lint/eslintrc-gjs.json
new file mode 100644
index 0000000..b467299
--- /dev/null
+++ b/lint/eslintrc-gjs.json
@@ -0,0 +1,113 @@
+{
+    "env": {
+        "es6": true
+    },
+    "extends": "eslint:recommended",
+    "rules": {
+        "array-bracket-newline": [
+            "error",
+            "consistent"
+        ],
+        "array-bracket-spacing": [
+            "error",
+            "never"
+        ],
+        "brace-style": "error",
+        "comma-spacing": [
+            "error",
+            {
+                "before": false,
+                "after": true
+            }
+        ],
+        "indent": [
+            "error",
+            4,
+            {
+                "MemberExpression": "off"
+            }
+        ],
+        "key-spacing": [
+            "error",
+            {
+                "beforeColon": false,
+                "afterColon": true
+            }
+        ],
+        "keyword-spacing": [
+            "error",
+            {
+                "before": true,
+                "after": true
+            }
+        ],
+        "linebreak-style": [
+            "error",
+            "unix"
+        ],
+        "no-empty": [
+            "error",
+            {
+                "allowEmptyCatch": true
+            }
+        ],
+        "no-implicit-coercion": [
+            "error",
+            {
+                "allow": ["!!"]
+            }
+        ],
+        "nonblock-statement-body-position": [
+            "error",
+            "below"
+        ],
+        "object-curly-newline": [
+            "error",
+            {
+                "consistent": true
+            }
+        ],
+        "object-curly-spacing": "error",
+        "prefer-template": "error",
+        "quotes": [
+            "error",
+            "single",
+            {
+                "avoidEscape": true
+            }
+        ],
+        "semi": [
+            "error",
+            "always"
+        ],
+        "semi-spacing": [
+            "error",
+            {
+                "before": false,
+                "after": true
+            }
+        ],
+        "space-before-blocks": "error",
+        "space-infix-ops": [
+            "error",
+            {
+                "int32Hint": false
+            }
+        ]
+    },
+    "globals": {
+        "ARGV": false,
+        "Debugger": false,
+        "GIRepositoryGType": false,
+        "imports": false,
+        "Intl": false,
+        "log": false,
+        "logError": false,
+        "print": false,
+        "printerr": false,
+        "window": false
+    },
+    "parserOptions": {
+        "ecmaVersion": 2017
+    }
+}


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