-
Notifications
You must be signed in to change notification settings - Fork 525
/
.eslintrc.json
61 lines (61 loc) · 2.04 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es2021": true,
// This could be enabled on a per directory basis in theory,
// But we need node for `src/desktop`, `buildSrc`, as well as our build scripts at the top level
// so it would be a bit much
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
// It is important that prettier is the last in the list,
// Or the output of `npm run fix` will fail `npm run check`
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "unicorn"],
"rules": {
// These rules have hits when running eslint (in ascending order of frequency) *after* running prettier and eslint --fix
// We should work to re-enable these rules, or at least most of them (some are very prevalent)
"no-control-regex": 0,
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
"@typescript-eslint/no-this-alias": 0,
"no-async-promise-executor": 0,
"@typescript-eslint/no-var-requires": 0,
"no-empty-pattern": 0,
"no-inner-declarations": 0,
"no-irregular-whitespace": 0,
"no-constant-condition": 0,
"prefer-rest-params": 0,
"prefer-spread": 0,
"no-prototype-builtins": 0,
"no-var": 0,
"no-undef": 0,
"no-fallthrough": 0,
"no-empty": 0,
"@typescript-eslint/ban-types": 0,
"no-useless-escape": 0,
"no-case-declarations": 0,
"prefer-const": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-inferrable-types": 0,
"unicorn/prefer-node-protocol": 2,
// foreach is a legacy ad-hoc thing that should be avoided. for..of loops
// 1. have proper control flow (e.g. break)
// 2. work with async/await
// 3. work with static code analysis, e.g. type checking
// 4. work with any iterable object
"unicorn/no-array-for-each": 2,
"unicorn/prefer-array-some": 2
}
}