]> git.openstreetmap.org Git - nominatim-ui.git/blob - .eslintrc.js
Merge remote-tracking branch 'upstream/master'
[nominatim-ui.git] / .eslintrc.js
1 module.exports = {
2   extends: [
3     'airbnb-base/legacy',
4     'plugin:mocha/recommended'
5   ],
6   parserOptions: {
7     ecmaVersion: 2019,
8     sourceType: 'module'
9   },
10   env: {
11     browser: true,
12     jquery: 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 };