-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
76 lines (62 loc) · 1.85 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
import globals from "globals";
import babelParser from "@babel/eslint-parser";
export default [{
ignores: ["!**/.eslintrc.js", "eslint.config.mjs"],
}, {
languageOptions: {
globals: {
...globals.browser,
...globals.webextensions,
},
// This is for a workaround to avoid parsing error around static properties defined in class definitions.
// See also: https://stackoverflow.com/questions/42701440/eslint-parsing-error-unexpected-token-error-for-assigned-fat-arrow-prop
parser: babelParser,
parserOptions: {
requireConfigFile: false,
},
ecmaVersion: 2020,
sourceType: "script",
},
rules: {
"no-const-assign": "error",
"prefer-const": ["warn", {
destructuring: "any",
ignoreReadBeforeAssign: false,
}],
indent: ["warn", 2, {
SwitchCase: 1,
MemberExpression: 1,
CallExpression: {
arguments: "first",
},
VariableDeclarator: {
var: 2,
let: 2,
const: 3,
},
}],
"no-underscore-dangle": ["warn", {
allowAfterThis: true,
}],
quotes: ["warn", "single", {
avoidEscape: true,
allowTemplateLiterals: true,
}],
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-undef": ["error", {
typeof: true,
}],
"no-unused-vars": ["warn", {
vars: "all",
args: "after-used",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
}],
"no-use-before-define": ["error", {
functions: false,
classes: true,
}],
},
}];