]> git.openstreetmap.org Git - nominatim-ui.git/blob - eslint.config.mjs
Rebundle latest version
[nominatim-ui.git] / eslint.config.mjs
1 import svelte from "eslint-plugin-svelte";
2 import mocha from "eslint-plugin-mocha";
3 import prettier from "eslint-plugin-prettier/recommended";
4 import security from 'eslint-plugin-security';
5 import globals from "globals";
6 import path from "node:path";
7 import { fileURLToPath } from "node:url";
8 import js from "@eslint/js";
9
10 export default [
11     js.configs.recommended,
12     mocha.configs.recommended,
13     ...svelte.configs.recommended,
14 {
15     plugins: {
16         svelte,
17         mocha,
18         prettier,
19         security,
20     },
21
22     languageOptions: {
23         globals: {
24             ...globals.browser,
25             ...globals.node
26         },
27
28         ecmaVersion: 2022,
29         sourceType: "module",
30     },
31 }, {
32     files: ["**/*"],
33
34     languageOptions: {
35         globals: {
36             L: true,
37             Nominatim_Config: true,
38         },
39     },
40
41     rules: {
42         camelcase: "off",
43         "func-names": "off",
44         "vars-on-top": "off",
45         "new-cap": "off",
46         "no-multiple-empty-lines": "off",
47
48         "no-use-before-define": ["error", {
49             functions: false,
50         }],
51
52         "padded-blocks": "off",
53         "no-param-reassign": "off",
54
55         "max-len": ["error", 100, 2, {
56             ignoreUrls: true,
57         }],
58
59         "svelte/require-each-key": "off",
60         "svelte/no-immutable-reactive-statements": "off"
61     },
62 }, {
63     files: ["test/**"],
64
65     languageOptions: {
66         globals: {
67             browser: true,
68         },
69     },
70 }, {
71     files: ["src/color-mode-toggler.js"],
72     rules: {
73         "semi": "off",
74         "max-len": "off"
75     }
76 }];