This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 260
/
.eslintrc
90 lines (90 loc) · 3.35 KB
/
.eslintrc
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
{
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"modules": true
},
"sourceType": "module"
},
"parser": "babel-eslint",
"plugins": ["prettier", "flowtype", "import", "jest"],
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:flowtype/recommended",
"prettier"
],
"env": {
"es6": true,
"node": true,
"browser": true,
"webextensions": true,
"jest": true,
"jasmine": true
},
"globals": {},
"rules": {
"camelcase": "off", // airbnb-base: camelcase is used a lot (protobuf)
"no-plusplus": "off", // airbnb-base: irrelevant
"no-bitwise": "off", // airbnb-base: used in hardending
"consistent-return": "off", // airbnb-base: irrelevant
"import/prefer-default-export": "off", // irrelevant
"import/no-extraneous-dependencies": "off", // TODO: until there are two versions of connect
"require-await": "error", // disabled by airbnb-base
"prettier/prettier": "error",
"no-underscore-dangle": "off", // TODO: underscore-dangle should be refactored
"class-methods-use-this": "off", // irrelevant, TODO: consider enabling after refactoring to TS
"no-await-in-loop": "off", // TODO: needs refactor in multiple files
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_", // allow underscored args,
"varsIgnorePattern": "^_" // allow underscored variables
}
],
"no-param-reassign": "off", // TODO: needs refactor
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"] // airbnb-base: allow ForInStatement and ForOfStatement
// "flowtype/object-type-delimiter": ["error", "semicolon"], // enforce flowtype semicolons, doesnt work with prettier
},
"overrides": [
{
"files": ["**/types/__tests__/*.js", "**/types/__tests__/*.ts"],
"rules": {
"no-unused-expressions": "off"
}
},
{
"files": [
"**/examples/**/*.js",
"**/scripts/**/*.js",
"**/tests/**/*.js",
"**/webpack/**/*.js"
],
"rules": {
"no-console": "off"
}
},
{
"files": [ "**/examples/**/*.js" ],
"rules": {
"import/no-unresolved": "off"
}
},
{
"files": [
"**/*.ts"
],
"parser": "@typescript-eslint/parser",
"plugins": ["import", "@typescript-eslint"],
"rules": {
"flowtype/no-types-missing-file-annotation": "off", // flowtype errors are irrelevant for typescript
"import/no-unresolved": "off", // imports are resolved below
"import/extensions": ["error", { "parser": "typescript" } ], // import typescript *.d.ts files
"no-unused-vars": "off", // api method params mostly
"no-shadow": "off", // typescript enum, use parser below
"@typescript-eslint/no-shadow": ["error"],
"prettier/prettier": ["error", {"semicolon": true, "parser": "typescript"}] // use ";" instead of ","
}
}
]
}