-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.eslintrc.js
58 lines (52 loc) · 1.49 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
"use strict";
module.exports = {
"env": {
es2022: true,
webextensions: true
},
"globals": {
messenger: true
},
"root": true,
"plugins": ["mozilla"],
"extends": ["plugin:mozilla/recommended"],
"rules": {
// experiment files are not ES modules, so we can't use static import
"mozilla/use-static-import": "off",
// We are still experimenting, console messages are ok for now
"no-console": "off",
// Some other rules that don't seem to be in the recommended set
"no-trailing-spaces": "error",
"eol-last": "error",
"quote-props": ["error", "consistent-as-needed", { keywords: true }],
"quotes": ["error", "double", { avoidEscape: true }],
"padded-blocks": ["error", "never"],
"indent": [2, 2, { SwitchCase: 1 }],
// Rules from https://searchfox.org/comm-central/source/.eslintrc.js#70
"complexity": ["error", 80],
"func-names": ["error", "never"],
"mozilla/prefer-boolean-length-check": "off",
// Enforce using `let` only when variables are reassigned.
"prefer-const": ["error", { destructuring: "all" }],
"mozilla/reject-chromeutils-import": "error",
},
"overrides": [
{
files: [".eslintrc.js"],
env: {
node: true,
browser: false,
},
},
{
files: ["*/experiments/*/parent/*.js", "*/experiments/*/child/*.js"],
globals: {
global: true,
Services: true,
},
rules: {
"mozilla/reject-importGlobalProperties": "off"
}
}
]
};