-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
eslint.config.mjs
94 lines (93 loc) · 2.53 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
// eslint.config.mjs
// ESLint flat configuration for JavaScript and JavaScript modules.
import globals from "globals"
import js from "@eslint/js"
export default [
{
ignores: ["ext/js/**"],
},
js.configs.recommended,
{
files: ["ext/.web-ext-chrome.js"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
{
files: ["ext/scripts/**/*.js", "test/**/*"],
languageOptions: {
ecmaVersion: "latest",
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
},
},
globals: {
...globals.browser,
browser: "readonly", // browser is for firefox only
chrome: "readonly",
},
},
linterOptions: {
noInlineConfig: false,
reportUnusedDisableDirectives: "error",
},
rules: {
"no-useless-assignment": "error",
"require-atomic-updates": "error",
"accessor-pairs": "warn",
"symbol-description": "warn",
"no-eval": "error",
"no-empty-function": "warn",
"no-empty": "warn",
"no-else-return": "warn",
"no-bitwise": "warn",
"no-var": "warn",
"no-undefined": "warn",
"no-undef-init": "warn",
"no-useless-constructor": "warn",
"no-useless-concat": "warn",
"no-useless-computed-key": "warn",
"no-unneeded-ternary": "warn",
"prefer-template": "warn",
"prefer-spread": "warn",
"prefer-rest-params": "warn",
"prefer-const": "warn",
"prefer-arrow-callback": "warn",
"operator-assignment": "warn",
"no-throw-literal": "warn",
"no-script-url": "warn",
"no-return-assign": "warn",
"no-proto": "warn",
"no-param-reassign": "warn",
"no-octal-escape": "warn",
"no-object-constructor": "warn",
"no-new-wrappers": "warn",
"no-new-func": "warn",
"no-new": "warn",
"no-nested-ternary": "warn",
"no-negated-condition": "warn",
"no-multi-assign": "warn",
// "no-magic-numbers": [
// "warn",
// {
// ignore: [-1, 0, 1, 2],
// ignoreArrayIndexes: true,
// ignoreDefaultValues: true,
// ignoreClassFieldInitialValues: true,
// enforceConst: true,
// },
// ],
"no-loop-func": "warn",
"no-lonely-if": "warn",
"no-implied-eval": "warn",
"no-implicit-globals": "warn",
"no-implicit-coercion": "warn",
"default-case-last": "warn",
"dot-notation": "warn",
eqeqeq: "warn",
"no-extend-native": "error",
},
},
]