-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
320 lines (312 loc) · 9.37 KB
/
.eslintrc.yml
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
settings:
react:
version: detect
parser: "babel-eslint"
parserOptions:
sourceType: "module"
allowImportExportEverywhere: false
ecmaVersion: 2015
ecmaFeatures:
globalReturn: false
babelOptions:
configFile: "babel.config.js"
env:
es6: true
node: true
jest: true
extends:
- "eslint:recommended"
- "plugin:react/recommended"
rules:
# Styling
arrow-body-style: ["error", "as-needed"]
arrow-parens: ["error", "always"]
arrow-spacing: ["error", { "before": true, "after": true }]
array-bracket-newline: ["error", "consistent"]
array-bracket-spacing: ["error", "never"]
array-element-newline: ["error", "consistent"]
block-spacing: error
brace-style: ["error", "stroustrup", { "allowSingleLine": true }]
camelcase:
- error
- properties: never
comma-spacing:
- error
- after: true
comma-style: ["error", "last"]
computed-property-spacing: ["error", "never"]
consistent-this: ["error", "that"]
comma-dangle:
- error
- always-multiline
eol-last: 1
generator-star-spacing: ["error", {"before": true, "after": false}]
indent: ["error", "tab"]
jsx-quotes: ["error", "prefer-double"]
func-call-spacing: ["error", "never"]
func-names: ["error", "as-needed"]
func-name-matching: ["error", "always"]
function-paren-newline: ["error", { "minItems": 3 }]
func-style: ["error", "expression"]
id-blacklist: ["error"]
id-length:
- error
- min: 1
max: 24
id-match: ["error", "^[a-z]*([A-Z]([A-Z]|[a-z])+)*$"]
key-spacing: ["error", { "beforeColon": false, "afterColon": true }]
keyword-spacing: ["error", {
"after": true,
"overrides": {
"if": { "after": false },
"for": { "after": false },
"while": { "after": false }
}
}]
line-comment-position: ["error", { "position": "above" }]
lines-around-comment: ["error", {
"beforeLineComment": false,
"afterLineComment": false,
"applyDefaultIgnorePatterns": true,
"ignorePattern": "Helpers|Tasks|Exports|Tested|Mocks"
}]
lines-between-class-members: ["error", "always"]
linebreak-style: ["error", "unix"]
max-depth: ["error", 4]
max-len: ["error", {
"code": 80,
"ignoreComments": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}]
max-lines: ["error", {
"max": 300, "skipBlankLines": true, "skipComments": true
}]
max-lines-per-function: ["error", {
"max": 20, "skipBlankLines": true, "skipComments": true
}]
max-nested-callbacks: ["error", 3]
max-params: ["error", 8]
max-statements: ["error", 10]
max-statements-per-line: ["error", { "max": 1 }]
multiline-ternary: ["error", "always-multiline"]
new-cap: ["error", { "capIsNew": false }]
new-parens: ["error"]
newline-per-chained-call: ["error", { "ignoreChainWithDepth": 2 }]
no-array-constructor: error
no-bitwise: error
no-confusing-arrow: ["error", {"allowParens": true}]
no-continue: error
no-duplicate-imports: error
no-extra-boolean-cast: error
no-extra-parens: ["error", "all", {
"enforceForArrowConditionals": false,
"nestedBinaryExpressions": false,
"returnAssign": false
}]
no-extra-semi: error
no-inline-comments: error
no-lonely-if: error
no-mixed-operators: error
no-mixed-spaces-and-tabs: error
no-multi-assign: error
no-multi-spaces: error
no-multiple-empty-lines:
- error
- max: 1
maxEOF: 0
no-new-object: error
no-regex-spaces: error
no-unsafe-negation: error
# no-restricted-syntax: [] # Check.
no-tabs: "off"
no-trailing-spaces: error
no-underscore-dangle: "error"
no-unneeded-ternary: error
no-useless-constructor: error
no-useless-computed-key: error
no-useless-rename: error
no-warning-comments: ["error", {
"terms": ["DEBUG"], "location": "anywhere"
}]
object-shorthand: ["error", "consistent-as-needed"]
nonblock-statement-body-position: ["error", "below"]
object-curly-newline: ["error", {
"consistent": true
}]
object-curly-spacing: ["error", "always", { "objectsInObjects": false }]
# object-property-newline: error # Waiting for refinement (to allow for variables as keys as well as values)
operator-assignment: ["error", "always"]
operator-linebreak: ["error", "before"]
padded-blocks: ["error", "never"]
padding-line-between-statements: [
"error",
{
blankLine: "always",
prev: ["const", "let", "var"],
next: "*"
},
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"]
}
]
prefer-object-spread: error
prefer-arrow-callback: error
one-var: ["error", "never"]
prefer-const: error
prefer-destructuring: ["error",{
"object": true,
"array": false
}]
prefer-numeric-literals: error
prefer-rest-params: error
prefer-spread: error
prefer-template: error
quote-props: ["error", "consistent-as-needed"]
quotes:
- error
- single
require-yield: error
symbol-description: error
template-curly-spacing: ["error", "always"]
yield-star-spacing: ["error", "after"]
semi: ["error", "always"]
space-before-blocks: error
space-before-function-paren: error
space-in-parens: ["error", "never"]
space-infix-ops: error
space-unary-ops: error
spaced-comment: ["error", "always", {
"line": {
"exceptions": []
}
}]
switch-colon-spacing: ["error", {"after": true, "before": false}]
template-tag-spacing: ["error", "always"]
unicode-bom: error
wrap-regex: error
no-lone-blocks: error
dot-notation: error
dot-location: ["error", "property"]
curly: ["error", "multi-or-nest"]
no-template-curly-in-string: error
# General
no-await-in-loop: error
no-console: error
no-debugger: error
strict: ["error", "never"]
# Variables
vars-on-top: error
init-declarations: ["error", "always"]
no-delete-var: error
no-dupe-args: error
no-global-assign: ["error", {"exceptions": []}]
no-func-assign: error
no-magic-numbers: [error, {
"ignore": [0, 1],
"ignoreArrayIndexes": true,
}]
no-restricted-globals: error
no-shadow: error
no-redeclare: error
no-shadow-restricted-names: error
no-unused-vars: error
no-use-before-define: error
no-undef: error
no-undef-init: error
no-var: error
# require-unicode-regexp: error # Disabled due to san issue with babel. Refer: https://github.com/babel/babel/issues/8951
# Comparisons
yoda: error
eqeqeq: error
no-eq-null: error
no-self-compare: error
# Numbers
no-floating-decimal: error
radix: error
no-label-var: error
no-extra-label: error
# Best Practices
complexity: ["error", { "max": 4 }]
no-new: error
no-new-func: error
no-octal-escape: error
no-param-reassign: error
no-proto: error
no-return-assign: ["error", "except-parens"]
no-return-await: error
no-useless-call: error
no-sequences: error
no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }]
no-unmodified-loop-condition: error
no-with: error
no-empty-pattern: error
no-multi-str: error
no-useless-return: error
no-useless-concat: error
no-throw-literal: error
no-loop-func: error
no-void: error
require-await: error
prefer-promise-reject-errors: error
# React
react/function-component-definition:
- error
- namedComponents: arrow-function
unnamedComponents: arrow-function
react/destructuring-assignment: ["error", "always"]
react/no-danger: error
react/no-children-prop: error
react/no-deprecated: error
react/no-set-state: error
react/no-this-in-sfc: error
react/no-unescaped-entities: error
react/no-unknown-property: error
react/no-unstable-nested-components: error
react/prop-types: ['error', {"skipUndeclared": true}]
react/prefer-stateless-function: error
react/react-in-jsx-scope: error
react/self-closing-comp: error
react/style-prop-object: error
react/void-dom-elements-no-children: error
## JSX
react/jsx-boolean-value: ["error", "always"]
react/jsx-child-element-spacing: error
react/jsx-closing-bracket-location: ["error", "tag-aligned"]
react/jsx-curly-brace-presence: ["error", "never"]
react/jsx-curly-newline: ["error", "consistent"]
react/jsx-curly-spacing: ["error", "always"]
react/jsx-equals-spacing: ["error", "never"]
# react/jsx-filename-extension: [1, { "extensions": [".js", ".jsx"] }] #LATER: Reconsider this rule.
react/jsx-first-prop-new-line: ["error", "multiline-multiprop"]
react/jsx-fragments: "error"
react/jsx-indent: ["error", "tab"]
react/jsx-indent-props: ["error", "tab"]
react/jsx-key: ["error", { "checkFragmentShorthand": true }]
react/jsx-max-depth: ["error", { "max": 10 }] #LATER: Reconsider the value.
react/jsx-max-props-per-line: ["error", { "maximum": 1, "when": "multiline" }]
react/jsx-newline: ["error", { "prevent": true }]
react/jsx-no-comment-textnodes: error
react/jsx-no-constructed-context-values: error
react/jsx-no-duplicate-props: error
react/jsx-no-script-url: error
react/jsx-no-target-blank: error
react/jsx-no-undef: error
react/jsx-no-useless-fragment: error
# react/jsx-one-expression-per-line: error #LATER: Reconsider this rule.
react/jsx-pascal-case: error
react/jsx-sort-props: ["error", {
"noSortAlphabetically": true,
"reservedFirst": true
}]
react/jsx-tag-spacing: ["error", {
"closingSlash": "never",
"beforeSelfClosing": "never",
"afterOpening": "never",
"beforeClosing": "never"
}]
# react/jsx-wrap-multilines: error #LATER: Reconsider this rule.
# Security
# require-atomic-updates: error # Marked.