-
Notifications
You must be signed in to change notification settings - Fork 5
/
eslint.config.mjs
68 lines (65 loc) · 1.75 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
import globals from "globals";
import eslintConfigMgol from "eslint-config-mgol";
export default [
...eslintConfigMgol,
{
ignores: [
"node_modules/**",
"dist/**",
],
},
{
files: [ "*.js" ],
languageOptions: {
sourceType: "script",
globals: {
...globals.node,
},
},
rules: {
// Strict mode
"strict": ["error", "global"], // "global" in Node, "function" in a browser
},
},
{
files: [ "*.mjs" ],
languageOptions: {
sourceType: "module",
globals: {
...globals.node,
},
},
},
{
files: [ "src/**/*.js" ],
languageOptions: {
ecmaVersion: 5,
sourceType: "script",
globals: {
...globals.browser,
jQuery: false,
},
},
rules: {
// Strict mode
"strict": ["error", "function"], // "global" in Node, "function" in a browser
// Stylistic issues
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline"
}],
"id-blacklist": ["error", "event"],
// ECMAScript 6
"no-var": "off",
"object-shorthand": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
'id-denylist': ['error', 'event'],
},
},
];