forked from metabrainz/musicbrainz-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yaml
359 lines (336 loc) · 11.4 KB
/
.eslintrc.yaml
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
root: true
parser: "@babel/eslint-parser"
plugins:
- import
- react
- flowtype
- fb-flow
- react-hooks
env:
browser: true
node: true
es2020: true
globals:
# Real globals
$: readonly
jQuery: readonly
# Fake globals; these are auto-imported upon use by Webpack's
# ProvidePlugin, but look like real globals to eslint
__webpack_public_path__: writable
__DEV__: readonly
GLOBAL_JS_NAMESPACE: readonly
MUSICBRAINZ_RUNNING_TESTS: readonly
addColon: readonly
addColonText: readonly
hasOwnProp: readonly
hydrate: readonly
hyphenateTitle: readonly
invariant: readonly
nonEmpty: readonly
l: readonly
ln: readonly
lp: readonly
N_l: readonly
N_ln: readonly
N_lp: readonly
exp: readonly
texp: readonly
l_attributes: readonly
ln_attributes: readonly
lp_attributes: readonly
l_countries: readonly
ln_countries: readonly
lp_countries: readonly
l_instrument_descriptions: readonly
ln_instrument_descriptions: readonly
lp_instrument_descriptions: readonly
l_instruments: readonly
ln_instruments: readonly
lp_instruments: readonly
l_languages: readonly
ln_languages: readonly
lp_languages: readonly
l_relationships: readonly
ln_relationships: readonly
lp_relationships: readonly
l_scripts: readonly
ln_scripts: readonly
lp_scripts: readonly
l_statistics: readonly
ln_statistics: readonly
lp_statistics: readonly
settings:
flowtype:
onlyFilesWithFlowAnnotation: true
react:
version: detect
flowVersion: 0.152.0
rules:
# Possible Errors
for-direction: error
no-async-promise-executor: error
no-cond-assign: warn
no-constant-condition: [error, {checkLoops: false}]
no-control-regex: off
no-debugger: error
no-dupe-args: error
no-dupe-keys: error
no-duplicate-case: error
no-empty-character-class: error
no-empty: [error, {allowEmptyCatch: true}]
no-extra-semi: warn
no-irregular-whitespace: warn
no-misleading-character-class: error
no-obj-calls: error
no-prototype-builtins: warn
no-regex-spaces: error
no-shadow-restricted-names: error
no-sparse-arrays: error
no-unexpected-multiline: error
no-unreachable: error
no-unsafe-finally: error
no-unsafe-negation: error
no-unused-vars: error
no-with: error
require-atomic-updates: error
use-isnan: error
valid-typeof: error
# Best Practices
block-scoped-var: warn
class-methods-use-this: off
consistent-return: error
curly: [error, all]
dot-location: [warn, property]
dot-notation: [warn, {allowKeywords: true}]
no-alert: off
no-else-return: warn
no-eq-null: off
no-floating-decimal: warn
no-global-assign: error
no-multi-spaces: [error, {ignoreEOLComments: true}]
no-useless-catch: warn
radix: warn
# Strict Mode
strict: off
# Variables
no-undef: error
no-use-before-define: off
# Stylistic Issues
array-bracket-newline: [warn, consistent]
array-bracket-spacing: [warn, never]
array-element-newline: [warn, consistent]
block-spacing: [warn, always]
brace-style: [warn, 1tbs]
comma-dangle: [warn, {arrays: always-multiline,
objects: always-multiline,
imports: always-multiline,
exports: always-multiline,
functions: always-multiline}]
comma-spacing: [warn, {before: false, after: true}]
comma-style: [warn, last]
computed-property-spacing: [warn, never, {"enforceForClassMembers": true}]
eol-last: [warn, always]
func-call-spacing: [warn, never]
function-paren-newline: [warn, consistent]
implicit-arrow-linebreak: [warn, beside]
indent: [warn, 2, {CallExpression: {arguments: first}, SwitchCase: 1, ignoredNodes: ["JSXElement", "ArrowFunctionExpression"]}]
jsx-quotes: [warn, prefer-double]
key-spacing: [warn, {mode: minimum}]
keyword-spacing: [warn, {before: true, after: true}]
linebreak-style: [warn, unix]
lines-between-class-members: [warn, always]
max-len: [warn, {code: 78,
ignoreUrls: true,
ignoreStrings: false,
ignoreTemplateLiterals: false,
ignoreRegExpLiterals: true}]
max-statements-per-line: [warn, {max: 1}]
multiline-comment-style: [warn, starred-block]
multiline-ternary: off
new-cap: off
new-parens: warn
newline-per-chained-call: [warn, {ignoreChainWithDepth: 3}]
no-lonely-if: warn
no-mixed-spaces-and-tabs: warn
no-multi-assign: off
no-multiple-empty-lines: [warn, {max: 2, maxBOF: 0, maxEOF: 0}]
no-negated-condition: warn
no-nested-ternary: off
no-plusplus: off
no-tabs: warn
no-ternary: off
no-trailing-spaces: warn
no-underscore-dangle: off
no-unneeded-ternary: warn
no-whitespace-before-property: warn
object-curly-newline: [warn, {multiline: true, consistent: true}]
object-curly-spacing: [warn, never]
object-property-newline: [warn, {allowAllPropertiesOnSameLine: true}]
one-var: [warn, never]
operator-assignment: [warn, always]
operator-linebreak: [warn]
padded-blocks: [warn, never]
quote-props: [warn, consistent-as-needed, {numbers: true}]
quotes: [warn, single, {avoidEscape: true,
allowTemplateLiterals: true}]
semi: [warn, always, {omitLastInOneLineBlock: true}]
semi-spacing: [warn, {before: false, after: true}]
semi-style: [warn, last]
space-before-blocks: [warn, always]
space-before-function-paren: [warn, {anonymous: always,
named: never,
asyncArrow: always}]
space-in-parens: [warn, never]
space-infix-ops: [warn, {int32Hint: true}]
space-unary-ops: [warn, {words: true, nonwords: false}]
spaced-comment: [warn, always, {block: {balanced: true}, markers: [":", "::"]}]
switch-colon-spacing: [warn, {after: true, before: false}]
template-tag-spacing: [warn, never]
# ECMAScript 6
constructor-super: error
no-class-assign: error
no-const-assign: error
no-dupe-class-members: error
# no-duplicate-imports does not support Flow 'type' imports, so we use
# the import/no-duplicates rule from eslint-plugin-import instead.
no-duplicate-imports: off
no-new-symbol: error
no-this-before-super: error
no-useless-constructor: warn
no-useless-rename: warn
prefer-numeric-literals: warn
require-yield: error
rest-spread-spacing: [warn, never]
# sort-imports does not support Flow 'type' imports, so we use the
# import/order rule from eslint-plugin-import instead.
sort-imports: off
template-curly-spacing: [warn, never]
########################
# eslint-plugin-import #
########################
import/export: error
import/extensions: [warn, never]
import/first: warn
import/newline-after-import: [warn, {count: 1}]
import/no-commonjs: error
import/no-duplicates: warn
import/no-dynamic-require: error
import/no-unresolved: error
import/order: [warn, {newlines-between: always}]
#######################
# eslint-plugin-react #
#######################
react/boolean-prop-naming: off
react/button-has-type: error
react/default-props-match-prop-types: off
react/destructuring-assignment: off
react/display-name: off
react/forbid-component-props: off
react/forbid-dom-props: off
react/forbid-elements: off
react/forbid-prop-types: off
react/forbid-foreign-prop-types: off
react/no-array-index-key: off
react/no-children-prop: error
react/no-danger: off
react/no-danger-with-children: error
react/no-deprecated: error
# Using setState in componentDidMount is necessary when the state depends
# on the size/attributes of a DOM node, for example.
react/no-did-mount-set-state: off
react/no-did-update-set-state: error
react/no-direct-mutation-state: error
react/no-find-dom-node: warn
react/no-is-mounted: warn
react/no-redundant-should-component-update: error
react/no-set-state: off
react/no-typos: error
react/no-string-refs: warn
react/no-this-in-sfc: error
react/no-unescaped-entities: error
react/no-unknown-property: error
react/no-unused-prop-types: off
react/no-unused-state: error
react/no-will-update-set-state: error
react/prefer-es6-class: off
react/prefer-stateless-function: warn
react/prop-types: off
# react-in-jsx-scope is not needed now that we've enabled
# https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
react/react-in-jsx-scope: off
react/require-default-props: off
react/require-optimization: off
react/require-render-return: error
react/self-closing-comp: error
react/sort-comp: off
react/sort-prop-types: off
react/style-prop-object: error
react/void-dom-elements-no-children: error
# JSX-specific rules
react/jsx-boolean-value: [warn, never]
react/jsx-closing-bracket-location: [error, tag-aligned]
react/jsx-closing-tag-location: error
react/jsx-curly-spacing: [error, {when: never, children: true}]
react/jsx-equals-spacing: [error, never]
react/jsx-filename-extension: [error, {extensions: [.js]}]
react/jsx-first-prop-new-line: [error, multiline-multiprop]
react/jsx-handler-names: warn
react/jsx-indent: [error, 2]
react/jsx-indent-props: [error, 2]
react/jsx-key: warn
react/jsx-max-props-per-line: [error, {maximum: 1, when: multiline}]
react/jsx-no-comment-textnodes: warn
react/jsx-no-duplicate-props: [error, {ignoreCase: true}]
react/jsx-no-literals: warn
react/jsx-no-target-blank: error
react/jsx-no-undef: [error, {allowGlobals: true}]
react/jsx-one-expression-per-line: [warn, {allow: single-child}]
react/jsx-curly-brace-presence: [error, {props: never, children: ignore}]
react/jsx-pascal-case: error
react/jsx-sort-default-props: warn
react/jsx-sort-props: warn
react/jsx-tag-spacing: [error, {beforeClosing: never}]
# jsx-uses-react is not implied since
# https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
react/jsx-uses-react: off
react/jsx-uses-vars: warn
react/jsx-wrap-multilines: [error, {declaration: parens-new-line,
assignment: parens-new-line,
return: parens-new-line,
arrow: parens-new-line,
condition: ignore,
logical: ignore,
prop: ignore}]
##########################
# eslint-plugin-flowtype #
##########################
flowtype/boolean-style: [warn, boolean]
flowtype/define-flow-type: warn
flowtype/delimiter-dangle: [warn, always-multiline]
flowtype/generic-spacing: [warn, never]
flowtype/no-dupe-keys: error
flowtype/no-flow-fix-me-comments: off
flowtype/no-mutable-array: off
flowtype/no-primitive-constructor-types: error
flowtype/object-type-delimiter: [warn, comma]
flowtype/require-exact-type: off
flowtype/require-indexer-name: [warn, always]
flowtype/require-parameter-type: off
flowtype/require-return-type: off
flowtype/require-valid-file-annotation: off
flowtype/semi: [warn, always]
flowtype/sort-keys: [warn, asc]
flowtype/space-after-type-colon: [warn, always, {allowLineBreak: true}]
flowtype/space-before-generic-bracket: [warn, never]
flowtype/space-before-type-colon: [warn, never]
flowtype/union-intersection-spacing: [warn, always]
flowtype/use-flow-type: warn
#########################
# eslint-plugin-fb-flow #
#########################
fb-flow/use-indexed-access-type: error
#############################
# eslint-plugin-react-hooks #
#############################
react-hooks/exhaustive-deps: error
react-hooks/rules-of-hooks: error