This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
88 lines (73 loc) · 2.74 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
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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
// Using `object` has not caused us any confusion so far.
"@typescript-eslint/ban-types": "off",
// Sometimes `any` is the right answer.
"@typescript-eslint/explicit-module-boundary-types": ["error", {
allowArgumentsExplicitlyTypedAsAny: true
}],
"@typescript-eslint/explicit-function-return-type": ["error", {
allowExpressions: true,
allowTypedFunctionExpressions: true
}],
"@typescript-eslint/member-delimiter-style": ["error", {
multiline: {
delimiter: "semi",
requireLast: true
},
singleline: {
delimiter: "comma",
requireLast: false
}
}],
// That's just stupid.
"@typescript-eslint/no-empty-function": "off",
// In general I would agree but in this package in makes sense for forward compatibility.
"@typescript-eslint/no-empty-interface": "off",
// Sometimes `any` is the right answer.
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": ["error", {
ignoreParameters: true
}],
// Namespaces that overlap interfaces are useful.
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-use-before-define": ["error", {
// Functions are hoisted. This is not a logic error.
functions: false
}],
"@typescript-eslint/no-unused-vars": ["error", {
// Often useful to document functions.
args: "none"
}],
// Use the logger instead.
"no-console": "error",
// Needed to allow functions exported from namespaces.
"no-inner-declarations": "off",
"no-constant-condition": ["error", {
// Allow the while(true) pattern.
checkLoops: false
}],
"no-restricted-properties": [2, {
object: "describe",
property: "only",
message: "This is ok for development but should not be checked in."
}, {
object: "it",
property: "only",
message: "This is ok for development but should not be checked in."
}],
// Not everybody understands the regex spec in that level of detail to recognize
// unnecessary escapes. Sometimes the extra escape adds clarity.
"no-useless-escape": "off"
}
};