-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
110 lines (93 loc) · 3.49 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* eslint environment configuration
*/
{
// indicates this is the root directory
"root": true,
"env": {
"node": true // configure ESLint for Node.js
},
// tells ESLint to use the given package to parse the source files
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"tsconfigRootDir": "__dirname"
},
/**
* Tells ESLint to load the given packages as a plugin, this allows us to
* use typescript-eslint's rules within the codebase.
*/
"plugins": [
"@typescript-eslint",
"local"
],
// tells ESLint that this configuration extends the given configurations
"extends": [
"eslint:recommended", // ESLint's inbuilt "recommended" config - https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
"plugin:@typescript-eslint/recommended" // ESLint's inbuilt "recommended" config - TypeScript-specific
// "plugin:@typescript-eslint/recommended-type-checked"
],
"rules": {
"semi": "off",
"@typescript-eslint/semi": "error",
"no-empty": "off",
"no-constant-condition": "off",
"prefer-rest-params": "off",
"no-inner-declarations": "off",
"no-useless-catch": "warn", // could be 'off'
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": [
"error", {
"types": {
"{}": false
}
}
],
"@typescript-eslint/no-unused-vars": "off", // could be 'warn'
"@typescript-eslint/no-empty-interface": "off", // could be 'warn'
"@typescript-eslint/no-empty-function": "off", // could be 'warn'
"eqeqeq": "error",
"local/explicit-member-accessibility": [
"error",
{
"accessibility": "explicit",
"ignoredMethodNames": ["Symbol.iterator"],
"ignoredPropertyNames": ["_serviceMarker"],
"overrides": {
"accessors": "off",
"constructors": "off",
"methods": "explicit",
"properties": "explicit",
"parameterProperties": "explicit"
}
}
],
"local/code-no-plain-enum": "error",
"local/code-no-json-stringify": "warn",
"local/code-interface-check": "error",
"local/code-service-marker": "error",
"local/code-no-throw": "warn",
"local/code-must-handle-result": "error"
},
"overrides": [
{
"files": [
"**/test/**/*.test.ts"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-empty-function": "off",
"local/code-no-plain-enum": "warn",
"local/test-code-detect-skip": "warn",
"local/test-code-no-only": "error",
"local/explicit-member-accessibility": "off",
"local/code-no-throw": "off"
}
}
]
}