]> git.openstreetmap.org Git - nominatim-ui.git/blob - .eslintrc.json
npm package updates
[nominatim-ui.git] / .eslintrc.json
1 // https://eslint.org/docs/latest/user-guide/configuring/configuration-files
2 {
3   "extends": [
4     "airbnb-base/legacy",
5     "plugin:mocha/recommended"
6   ],
7   "parserOptions": {
8     "ecmaVersion": 2019,
9     "sourceType": "module"
10   },
11   "env": {
12     "browser": true
13   },
14   "plugins": [
15     "svelte3",
16     "mocha"
17   ],
18   "overrides": [
19     {
20       "files": ["*"],
21       "globals": {
22         "L": true, // leaflet library
23         "Nominatim_Config": true
24       },
25       "rules": {
26         "camelcase": "off", // my_var is fine, no need for myVar
27         "func-names": "off", // anonymous "function()" is fine
28         "vars-on-top": "off",
29         "new-cap": "off", // constructor name can start lowercase (as Leaflet does)
30         "no-multiple-empty-lines": "off",
31         "no-use-before-define": ["error", { "functions": false }],
32         "padded-blocks": "off",
33         "no-param-reassign": "off",
34         "max-len": [
35           "error",
36           100,
37           2,
38           {
39             "ignoreUrls": true,
40             "ignoreComments": false
41           }
42         ]
43       }
44     },
45     {
46       "files": ["*.svelte"],
47       "processor": "svelte3/svelte3",
48       "rules": {
49         "no-label-var": "off" // eslint thinks $: (https://svelte.dev/tutorial/reactive-statements) are labels
50       }
51     },
52     {
53       "files": ["test/**"],
54       "globals": {
55         "browser": true
56       }
57     }
58   ]
59 }