-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy patheslint.config.mjs
95 lines (93 loc) · 3 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
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import {fixupConfigRules} from "@eslint/compat";
export default [
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
chrome: "readonly",
browser: "readonly",
...globals.browser
}
},
settings: {
react: {
version: "detect"
},
},
ignores: [
"addon/react-dom.js",
"addon/react-dom.min.js",
"addon/react.js",
"addon/react.min.js",
"venv/*",
"docs/venv/*",
"target/"
],
rules: {
"indent": ["error", 2, {"SwitchCase": 1, "flatTernaryExpressions": true}],
"quotes": ["error", "double", {"avoidEscape": true}],
"semi": ["error", "always"],
"strict": ["error", "global"],
"consistent-return": "error",
"curly": ["error", "multi-line"],
"dot-location": ["error", "property"],
"no-multi-spaces": "error",
"array-bracket-spacing": "error",
"block-spacing": "error",
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"camelcase": "error",
"comma-dangle": ["error", "only-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": "error",
"consistent-this": ["error", "self"],
"eol-last": "error",
"func-call-spacing": "error",
"key-spacing": "error",
"keyword-spacing": "error",
"new-cap": "error",
"no-array-constructor": "error",
"no-lonely-if": "error",
"no-mixed-operators": "error",
"no-new-object": "error",
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": ["error", {"allowAfterThis": true, "allowAfterSuper": true}],
"no-whitespace-before-property": "error",
"object-curly-spacing": "error",
"object-property-newline": ["error", {"allowMultiplePropertiesPerLine": true}],
"one-var-declaration-per-line": "error",
"operator-linebreak": ["error", "before"],
"semi-spacing": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"unicode-bom": "error",
"arrow-body-style": "error",
"arrow-spacing": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": ["error", {"allowNamedFunctions": true}],
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"rest-spread-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"yield-star-spacing": "error"
}
},
pluginJs.configs.recommended,
...fixupConfigRules(pluginReactConfig),
];