-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy patheslint.config.mjs
102 lines (98 loc) · 3.1 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import js from "@eslint/js";
import jsdoc from "eslint-plugin-jsdoc";
import stylisticJs from '@stylistic/eslint-plugin-js'
export default [
js.configs.recommended,
jsdoc.configs['flat/recommended'],
{
name: "Global",
ignores: [
"assets/src/legacy/",
"assets/dist/",
"assets/node_modules/",
"build/",
"docs/",
"lizmap/vendor/",
"node_modules/",
"lizmap/www/assets/jelix/",
"lizmap/www/assets/js/",
"tests/end2end/cypress/", // Candidate for to be removed
"tests/js-units/node/",
"tests/units/vendor/",
],
}, {
plugins: {
jsdoc,
'@stylistic/js': stylisticJs
},
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
OpenLayers: "readonly",
lizMap: "readonly",
lizDict: "readonly",
lizUrls: "readonly",
lizProj4: "readonly",
window: "readonly",
document: "readonly",
Document: "readonly",
HTMLElement: "readonly",
Node: "readonly",
console: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
Event: "readonly",
MouseEvent: "readonly",
Response: "readonly",
Element: "readonly",
$: "readonly",
jQuery: "readonly",
TemplateResult: "readonly",
SelectionTool: "readonly",
Digitizing: "readonly",
Geometry: "readonly",
Extent: "readonly",
ResponseError: "readonly",
HttpError: "readonly",
NetworkError: "readonly",
LocateByLayerConfig: "readonly",
Config: "readonly",
Layers: "readonly",
},
},
rules: {
"@stylistic/js/indent": [
'error', 4, {
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral *"],
}
],
"@stylistic/js/max-len": [
"error", 400, 4], // It's a temporary value, until we fix some.
"no-prototype-builtins": "off",
"no-undef": "off",
'jsdoc/require-description': 'warn',
},
}, {
files: [
"tests/end2end/playwright/",
"tests/qgis-projects/tests/",
],
ignores: [
"tests/end2end/playwright/globals.js",
],
rules: {
"indent": ["error", 4, {
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral *"],
}],
"no-prototype-builtins": "off",
"no-undef": "off",
"object-shorthand": 0,
'jsdoc/require-description': 'warn',
},
}
];