]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - .eslintrc.json
version 3.2.11
[nominatim-ui.git] / .eslintrc.json
index 6af997f8b53fa4f9eb2e8a5b566ca666daeb3a54..908eb4d736bd19ce42f481e174992487f4f7886f 100644 (file)
@@ -1,26 +1,34 @@
+// https://eslint.org/docs/latest/user-guide/configuring/configuration-files
 {
   "extends": [
-    "airbnb-base/legacy"
+    "airbnb-base/legacy",
+    "plugin:mocha/recommended"
   ],
-  "parser": "espree",
+  "parserOptions": {
+    "ecmaVersion": 2019,
+    "sourceType": "module"
+  },
   "env": {
-    "browser": true,
-    "jquery": true
+    "browser": true
   },
+  "plugins": [
+    "svelte3",
+    "mocha"
+  ],
   "overrides": [
     {
       "files": ["*"],
       "globals": {
-        "Nominatim_Config": true,
-        "Handlebars": true,
-        "L": true // leaflet library
+        "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
+        "func-names": "off", // anonymous "function()" is fine
         "vars-on-top": "off",
         "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": [
           }
         ]
       }
+    },
+    {
+      "files": ["*.svelte"],
+      "processor": "svelte3/svelte3",
+      "rules": {
+        "no-label-var": "off" // eslint thinks $: (https://svelte.dev/tutorial/reactive-statements) are labels
+      }
+    },
+    {
+      "files": ["test/**"],
+      "globals": {
+        "browser": true
+      }
     }
   ]
 }