]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - .eslintrc.json
npm package updates
[nominatim-ui.git] / .eslintrc.json
index 7f85a89f4b5a4bcde3aa39995ff044f82507fb1a..a05265dc40e4dc63fdc7b27b1560d4926288d659 100644 (file)
@@ -1,28 +1,52 @@
+// https://eslint.org/docs/latest/user-guide/configuring/configuration-files
 {
 {
-    "env": {
-        "browser": true,
-        // "es6": true,
-        "jquery": true
-    },
-    "extends": [
-        "airbnb-base"
-    ],
-    "globals": {
-        "jQuery": true,
-        "Handlebars": true,
-        "L": true // Leaflet
-    },
-    "parserOptions": {
-        "ecmaVersion": 2018
-    },
-    "rules": {
-        "camelcase": "off", // abd_def is fine
+  "extends": [
+    "airbnb-base/legacy",
+    "plugin:mocha/recommended",
+    "plugin:svelte/recommended"
+  ],
+  "parserOptions": {
+    "ecmaVersion": 2019,
+    "sourceType": "module"
+  },
+  "env": {
+    "browser": true
+  },
+  "plugins": [
+    "svelte",
+    "mocha"
+  ],
+  "overrides": [
+    {
+      "files": ["*"],
+      "globals": {
+        "L": true, // leaflet library
+        "Nominatim_Config": true
+      },
+      "rules": {
+        "camelcase": "off", // my_var is fine, no need for myVar
+        "func-names": "off", // anonymous "function()" is fine
         "vars-on-top": "off",
         "vars-on-top": "off",
-        "comma-dangle": "off", // no comman after last item in list needed
-        "func-names": "off", // anonymous 'function()' is fine
-        "object-shorthand": "off",
-        "prefer-arrow-callback": "off",
-        "prefer-template": "off", // don't require emplates
-        "no-var": "off" // don't require let/const
+        "new-cap": "off", // constructor name can start lowercase (as Leaflet does)
+        "no-multiple-empty-lines": "off",
+        "no-use-before-define": ["error", { "functions": false }],
+        "padded-blocks": "off",
+        "no-param-reassign": "off",
+        "max-len": [
+          "error",
+          100,
+          2,
+          {
+            "ignoreUrls": true
+          }
+        ]
+      }
+    },
+    {
+      "files": ["test/**"],
+      "globals": {
+        "browser": true
+      }
     }
     }
-}
\ No newline at end of file
+  ]
+}