-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
102 lines (96 loc) · 2.13 KB
/
.eslintrc.js
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
module.exports = {
extends: [
"eslint:recommended"
],
ignorePatterns: [
"/*",
"**/_*",
"**/*fork",
"!scripts/",
"!src/",
"!starter_kit/",
"!test/**",
"!.eslintrc.js"
],
env: {
es6: true
},
parserOptions: {
ecmaVersion: 2020,
sourceType: "module"
},
rules: {
"max-len": ["error", 120],
"eol-last": ["error", "never"],
quotes: ["error", "double", { avoidEscape: true }],
"arrow-parens": ["error", "as-needed"],
"quote-props": ["error", "as-needed"],
"comma-dangle": ["error", "never"],
"no-empty": ["error", { allowEmptyCatch: true }],
"space-unary-ops": ["error", { words: false }],
"space-infix-ops": "error",
"object-curly-spacing": ["error", "always", {
// arraysInObjects: false
}],
"no-extra-parens": ["error", "all", {
conditionalAssign: false
}],
"comma-spacing": ["error", { before: false, after: true }],
"arrow-spacing": "error",
"func-call-spacing": "error",
"key-spacing": ["error", { afterColon: true }],
"keyword-spacing": ["error", { before: true }],
"space-before-function-paren": ["error", {
anonymous: "never",
named: "never",
asyncArrow: "always"
}]
},
overrides: [
{
files: ["*.js"],
env: { node: true },
rules: {
indent: [
2, 2, {
SwitchCase: 1
}],
"no-prototype-builtins": "off"
}
},
{
files: ["src/*.mjs"],
env: {
browser: true
},
rules: {
indent: [
2, 4, {
SwitchCase: 1
}]
},
globals: {
globalThis: "readonly", // not yet supported
process: "readonly", // only process is required
COMPILER_DEV: "readonly",
COMPILER_DEBUG: "readonly",
COMPILER_CLI: "readonly",
jFactoryOverride: "readonly",
StackTrace: "readonly"
}
},
{
files: ["test/*.test.js"],
env: {
browser: true,
mocha: true
},
rules: {
indent: [
2, 4
],
"require-atomic-updates": "off"
}
}
]
};