-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
182 lines (181 loc) · 5.4 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{
"env": {
"es6": true
},
"globals": {
"__BUILDNUM__": "readonly",
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "module",
"project": "tsconfig.json"
},
"plugins": ["@typescript-eslint", "import"],
"rules": {
"array-bracket-spacing": ["error"],
"block-spacing": ["error"],
"comma-spacing": ["error"],
"dot-location": ["error", "property"],
"eqeqeq": ["error"],
"key-spacing": ["error"],
"linebreak-style": ["error", "unix"],
"max-len": ["error", {
"code": 100,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true
}],
"no-else-return": ["warn"],
"no-eq-null": ["error"],
"no-extra-bind": ["error"],
"no-multi-spaces": ["error"],
"no-multi-str": ["error"],
"no-multiple-empty-lines": ["error"],
"no-param-reassign": ["error"],
"no-return-assign": ["error"],
"no-return-await": ["error"],
"no-trailing-spaces": ["error"],
"no-undef-init": ["error"],
"no-unsafe-optional-chaining": ["error"],
"no-unused-vars": ["off"],
"no-useless-return": ["error"],
"object-curly-spacing": ["error", "always"],
"space-infix-ops": ["error", { "int32Hint": false }],
"yoda": ["error"],
"@typescript-eslint/dot-notation": ["error"],
"@typescript-eslint/comma-spacing": ["error"],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/no-namespace": ["off"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-floating-promises": [
"error",
{ "ignoreIIFE": true }
],
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/no-use-before-define": ["error", { "typedefs": false }],
"@typescript-eslint/require-await": ["error"],
"@typescript-eslint/type-annotation-spacing": ["error", { "after": true }],
"@typescript-eslint/prefer-includes": ["error"],
"@typescript-eslint/no-misused-new": ["error"],
"@typescript-eslint/no-for-in-array": ["error"],
"@typescript-eslint/no-explicit-any": ["error", { "ignoreRestArgs": true }],
"@typescript-eslint/prefer-nullish-coalescing": ["error"],
"@typescript-eslint/no-unsafe-call": ["error"],
"@typescript-eslint/no-unsafe-member-access": ["error"],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/await-thenable": ["error"],
"@typescript-eslint/array-type": ["error", { "default": "array" }],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": { "delimiter": "none" },
"singleline": { "delimiter": "semi", "requireLast": false }
}
],
"@typescript-eslint/indent": [
"error",
4,
{
"ignoredNodes": ["JSXAttribute"],
"SwitchCase": 1
}
],
"import/no-default-export": ["error"],
"import/order": ["error"],
"@typescript-eslint/no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true
}
],
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
"arrow-parens": ["error", "as-needed"],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"indent": "off",
"no-bitwise": "off",
"no-console": "off",
"no-empty": "off",
"no-fallthrough": "off",
"no-redeclare": "off",
"no-restricted-syntax": "off",
"no-shadow": "off", // Prevent conflicts with @typescript-eslint/no-shadow
"no-undef": "off",
"no-underscore-dangle": "off",
"no-unused-expressions": "off", // @typescript-eslint/no-unused-expressions used instead
"no-void": [
"error",
{
"allowAsStatement": true
}
],
"padding-line-between-statements": [
// See docs
"warn",
{
"blankLine": "always",
"prev": "*",
"next": "return"
}, // return
{
"blankLine": "always",
"prev": "*",
"next": "class"
}, // class
{
"blankLine": "always",
"prev": ["const", "let", "var"],
"next": "*"
}, // Variable declaration
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
},
{
"blankLine": "always",
"prev": ["case", "default"],
"next": "*"
}, // case in switch
{
"blankLine": "always",
"prev": "*",
"next": ["try", "switch", "for", "block-like"]
}, // blocks (try, switch, if, while, for, {})
{
"blankLine": "always",
"prev": ["try", "switch", "for", "block-like"],
"next": "*"
},
{
// Multiline
"blankLine": "always",
"prev": ["multiline-const", "multiline-expression", "multiline-let"],
"next": "*"
}
],
"prefer-spread": "off",
"quotes": ["error", "double"]
}
}