-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy patheslint.config.mjs
More file actions
126 lines (124 loc) · 3.34 KB
/
eslint.config.mjs
File metadata and controls
126 lines (124 loc) · 3.34 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import globals from "globals";
import js from "@eslint/js";
export default [{
ignores: ["config/mongo-init.js"]
}, js.configs.recommended, {
files: ["**/*.js"],
languageOptions: {
globals: {
...globals.node,
...globals.browser,
...globals.jquery,
},
ecmaVersion: 2022,
sourceType: "commonjs",
},
rules: {
strict: ["error", "global"],
"no-console": 0,
"no-empty": ["error", {
allowEmptyCatch: true,
}],
"require-atomic-updates": 0,
curly: 2,
"no-return-await": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-global-assign": 2,
"no-implicit-coercion": 2,
"no-implicit-globals": 2,
"no-implied-eval": 2,
"no-lone-blocks": 2,
"no-unused-vars": ["error", {
ignoreRestSiblings: true,
caughtErrors: "none"
}],
"no-useless-escape": 0,
"array-bracket-newline": ["warn", "consistent"],
"array-bracket-spacing": 1,
"block-spacing": 1,
"brace-style": ["warn", "1tbs", {
allowSingleLine: true,
}],
"comma-spacing": 1,
"computed-property-spacing": 1,
"eol-last": 1,
"func-call-spacing": 1,
indent: ["warn", 2, {
MemberExpression: 0,
SwitchCase: 1,
}],
"key-spacing": ["warn", {
mode: "minimum",
}],
"keyword-spacing": 1,
"linebreak-style": 1,
"lines-between-class-members": 1,
"new-parens": ["warn"],
"no-multiple-empty-lines": ["warn", {
max: 1,
}],
"no-trailing-spaces": 1,
"no-var": 1,
"object-curly-newline": ["warn", {
consistent: true,
}],
"object-curly-spacing": ["warn", "never"],
"one-var": ["warn", "never"],
"padded-blocks": ["warn", "never"],
"prefer-object-spread": 1,
quotes: ["warn", "single", {
avoidEscape: true,
}],
semi: ["warn", "always"],
"semi-spacing": 1,
"space-before-blocks": 1,
"space-before-function-paren": ["warn", {
anonymous: "never",
named: "never",
asyncArrow: "always",
}],
"space-in-parens": ["warn", "never"],
"space-infix-ops": 1,
"arrow-body-style": ["warn", "as-needed"],
"arrow-parens": ["warn", "as-needed"],
"arrow-spacing": 1,
"no-useless-constructor": 1,
"object-shorthand": ["warn", "always", {
avoidQuotes: true,
}],
"prefer-arrow-callback": ["warn", {
allowNamedFunctions: true,
}],
"prefer-const": ["warn", {
destructuring: "all",
}],
"prefer-template": 1,
"template-curly-spacing": ["warn", "never"],
"no-template-curly-in-string": "warn",
},
},
{
files: ["**/*.mjs"],
languageOptions: {
globals: {
...globals.node,
...globals.browser
},
ecmaVersion: 2022,
sourceType: "module"
}
},
{
files: ["test/**/*.js"],
languageOptions: {
globals: {
...globals.mocha,
expect: true,
sinon: true,
},
},
rules: {
"no-shadow": 1,
}
}];