-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
123 lines (123 loc) · 4.32 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/ban-types": [
"error",
{
types: {
Boolean: {
message: "Prefer boolean",
fixWith: "boolean",
},
Function: {
message:
"Function is an unsafe type, allowing unexpected assignments",
fixWith: "() => void",
},
Number: {
message: "Prefer number",
fixWith: "number",
},
String: {
message: "Prefer string",
fixWith: "string",
},
},
},
],
"@typescript-eslint/consistent-type-assertions": [
"error",
{ assertionStyle: "as", objectLiteralTypeAssertions: "never" },
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-readonly-parameter-types": [
"error",
{ ignoreInferredTypes: true, treatMethodsAsReadonly: true },
],
"@typescript-eslint/prefer-return-this-type": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"arrow-parens": ["error", "as-needed"],
complexity: "off",
"constructor-super": "error",
curly: "error",
"dot-notation": "error",
"eol-last": "error",
"guard-for-in": "error",
"linebreak-style": "off",
"max-classes-per-file": "off",
"new-parens": "off",
"newline-per-chained-call": "off",
"no-bitwise": "off",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-empty": "error",
"no-eval": "error",
"no-extra-semi": "off",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-irregular-whitespace": "off",
"no-multiple-empty-lines": "off",
"no-new-wrappers": "error",
"no-throw-literal": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"quote-props": "off",
radix: "error",
"space-before-function-paren": "off",
"use-isnan": "error",
"valid-typeof": "error",
},
overrides: [
{
files: ["Seq.ts", "AsyncSeq.ts", "index.ts"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
allowArgumentsExplicitlyTypedAsAny: true,
},
],
},
},
{
files: ["*.spec.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/restrict-plus-operands": "off",
},
},
{
files: ["scripts/*"],
rules: {
"no-console": "off",
},
},
],
}