forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteammates-eslint.yml
607 lines (407 loc) · 17.2 KB
/
teammates-eslint.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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
env:
browser: true
jquery: true
qunit: true
rules:
#################################################################################
# This ruleset includes all the rules given in http://eslint.org/docs/rules/,
# except for the NodeJS and ECMAScript 6 rules due to their irrelevance.
# All rules recommended by ESLint are activated.
#
# Further consultations are made with Airbnb and Google configs, and
# the rules recommended by them are mostly included, deactivated only when
# the rules are not compatible with our workflow.
#################################################################################
# Possible Errors
# disallow assignment operators in conditional expressions
no-cond-assign: ["error", "except-parens"]
# disallow the use of console
no-console: "error"
# disallow constant expressions in conditions
no-constant-condition: "error"
# disallow control characters in regular expressions
no-control-regex: "error"
# disallow the use of debugger
no-debugger: "error"
# disallow duplicate arguments in function definitions
no-dupe-args: "error"
# disallow duplicate keys in object literals
no-dupe-keys: "error"
# disallow duplicate case labels
no-duplicate-case: "error"
# disallow empty character classes in regular expressions
no-empty-character-class: "error"
# disallow empty block statements
no-empty: "error"
# disallow reassigning exceptions in catch clauses
no-ex-assign: "error"
# disallow unnecessary boolean casts
no-extra-boolean-cast: "error"
# disallow unnecessary parentheses
no-extra-parens: "error"
# disallow unnecessary semicolons
no-extra-semi: "error"
# disallow reassigning function declarations
no-func-assign: "error"
# disallow function or var declarations in nested blocks
no-inner-declarations: "error"
# disallow invalid regular expression strings in RegExp constructors
no-invalid-regexp: "error"
# disallow irregular whitespace outside of strings and comments
no-irregular-whitespace: "error"
# disallow calling global object properties as functions
no-obj-calls: "error"
# Disallow use of Object.prototypes builtins directly
# no-prototype-builtins: "off"
# disallow multiple spaces in regular expression literals
no-regex-spaces: "error"
# disallow sparse arrays
no-sparse-arrays: "error"
# Disallow template literal placeholder syntax in regular strings
# no-template-curly-in-string: "off"
# disallow confusing multiline expressions
no-unexpected-multiline: "error"
# disallow unreachable code after return, throw, continue, and break statements
no-unreachable: "error"
# disallow control flow statements in finally blocks
no-unsafe-finally: "error"
# disallow negating the left operand of relational operators
no-unsafe-negation: "error"
# require calls to isNaN() when checking for NaN
use-isnan: "error"
# enforce valid JSDoc comments
valid-jsdoc: "off" # recommended by Google
# enforce comparing typeof expressions against valid strings
valid-typeof: "error"
# Best Practices
# enforce getter and setter pairs in objects
# accessor-pairs: "off"
# enforce return statements in callbacks of array methods
# array-callback-return: "off"
# enforce the use of variables within the scope they are defined
block-scoped-var: "error"
# enforce that class methods utilize this
# class-methods-use-this: "off"
# enforce a maximum cyclomatic complexity allowed in a program
# complexity: "off"
# require return statements to either always or never specify values
consistent-return: "off" # recommended by Airbnb
# enforce consistent brace style for all control statements
curly: "error"
# require default cases in switch statements
default-case: "error"
# enforce consistent newlines before and after dots
dot-location: ["error", "property"]
# enforce dot notation whenever possible
dot-notation: "error"
# require the use of === and !==
eqeqeq: "error"
# require for-in loops to include an if statement
guard-for-in: "error"
# disallow the use of alert, confirm, and prompt
no-alert: "error"
# disallow the use of arguments.caller or arguments.callee
# no-caller: "off"
# disallow lexical declarations in case clauses
no-case-declarations: "error"
# disallow division operators explicitly at the beginning of regular expressions
# no-div-regex: "off"
# disallow else blocks after return statements in if statements
no-else-return: "error"
# disallow empty functions
no-empty-function: "error"
# disallow empty destructuring patterns
no-empty-pattern: "error"
# disallow null comparisons without type-checking operators
no-eq-null: "error"
# disallow the use of eval()
no-eval: "error"
# disallow extending native types
no-extend-native: "error"
# disallow unnecessary calls to .bind()
# no-extra-bind: "off"
# disallow unnecessary labels
# no-extra-label: "off"
# disallow fallthrough of case statements
no-fallthrough: "error"
# disallow leading or trailing decimal points in numeric literals
# no-floating-decimal: "off"
# disallow assignments to native objects or read-only global variables
no-global-assign: "error"
# no-return-await
# no-return-await: "off"
# disallow shorthand type conversions
no-implicit-coercion: "error"
# disallow var and named function declarations in the global scope
# no-implicit-globals: "off"
# disallow use of eval()-like methods
# no-implied-eval: "off"
# disallow this keywords outside of classes or class-like objects
# no-invalid-this: "off"
# disallow the use of the __iterator__ property
# no-iterator: "off"
# disallow labeled statements
# no-labels: "off"
# disallow unnecessary nested blocks
# no-lone-blocks: "off"
# disallow function declarations and expressions inside loop statements
no-loop-func: "off" # recommended by Airbnb and Google
# disallow magic numbers
# no-magic-numbers: "off"
# disallow multiple spaces
no-multi-spaces: "error"
# disallow multiline strings
# no-multi-str: "off"
# disallow new operators with the Function object
no-new-func: "error"
# disallow new operators with the String, Number, and Boolean objects
no-new-wrappers: "error"
# disallow new operators outside of assignments or comparisons
no-new: "error"
# disallow octal escape sequences in string literals
# no-octal-escape: "off"
# disallow octal literals
no-octal: "error"
# disallow reassigning function parameters
no-param-reassign: ["error", { "props": false }]
# disallow usage of __proto__ property
# no-proto: "off"
# disallow var redeclaration
no-redeclare: "error"
# disallow certain properties on certain objects
# no-restricted-properties: "off"
# disallow assignment operators in return statements
# no-return-assign: "off"
# disallow unnecessary return await
# no-return-await: "off"
# disallow javascript: urls
# no-script-url: "off"
# disallow assignments where both sides are exactly the same
no-self-assign: "error"
# disallow comparisons where both sides are exactly the same
# no-self-compare: "off"
# disallow comma operators
# no-sequences: "off"
# disallow throwing literals as exceptions
no-throw-literal: "error"
# disallow unmodified loop conditions
# no-unmodified-loop-condition: "off"
# disallow unused expressions
no-unused-expressions: "error"
# disallow unused labels
no-unused-labels: "error"
# disallow unnecessary calls to .call() and .apply()
no-useless-call: "error"
# disallow unnecessary concatenation of literals or template literals
no-useless-concat: "error"
# disallow unnecessary escape characters
no-useless-escape: "error"
# disallow redundant return statements
no-useless-return: "error"
# disallow void operators
# no-void: "off"
# disallow specified warning terms in comments
no-warning-comments: "off" # recommended by Google
# disallow with statements
# no-with: "off"
# enforce the consistent use of the radix argument when using parseInt()
radix: "off" # recommended by Airbnb and Google
# disallow async functions which have no await expression
# require-await: "off"
# require var declarations be placed at the top of their containing scope
vars-on-top: "off" # recommended by Airbnb
# require parentheses around immediate function invocations
wrap-iife: "off" # recommended by Airbnb
# require or disallow Yoda conditions
# yoda: "off"
# Strict Mode
# require or disallow strict mode directives
strict: "off" # recommended by Airbnb
# Variables
# require or disallow initialization in var declarations
# init-declarations: "off"
# disallow catch clause parameters from shadowing variables in the outer scope
# no-catch-shadow: "off"
# disallow deletion of variables
no-delete-var: "error"
# disallow labels that share a name with a variable
# no-label-var: "off"
# disallow specified global variables
# no-restricted-globals: "off"
# disallow identifiers from shadowing restricted names
# no-shadow-restricted-names: "off"
# disallow declaration of variables already declared in the outer scope
no-shadow: "off" # recommended by Airbnb
# disallow initializing variables to undefined
no-undef-init: "error"
# disallow the use of undeclared variables unless mentioned in /*global */ comments
no-undef: "off" # recommended by ESLint, Airbnb, and Google
# disallow the use of undefined as an identifier
no-undefined: "off" # recommended by Airbnb
# disallow unused variables
no-unused-vars: ["error", "local"]
# disallow use of variables before they are defined
no-use-before-define: "off" # recommended by Airbnb and Google
# Stylistic Issues
# enforce consistent spacing inside array brackets
array-bracket-spacing: "error"
# enforce consistent spacing inside single-line blocks
block-spacing: "error"
# enforce consistent brace style for blocks
brace-style: "error"
# enforce camelcase naming convention
camelcase: "error"
# enforce or disallow capitalization of the first letter of a comment
# capitalized-comments: "off"
# require or disallow trailing commas
comma-dangle: ["error", "never"]
# enforce consistent spacing before and after commas
comma-spacing: "error"
# enforce consistent comma style
comma-style: "error"
# enforce consistent spacing inside computed property brackets
computed-property-spacing: "error"
# enforce consistent naming when capturing the current execution context
# consistent-this: "off"
# enforce at least one newline at the end of files
eol-last: "error"
# require or disallow spacing between function identifiers and their invocations
func-call-spacing: "error"
# require function names to match the name of the variable or property to which they are assigned
# func-name-matching: "off"
# enforce named function expressions
func-names: "off" # recommended by Airbnb
# enforce the consistent use of either function declarations or expressions
# func-style: "off"
# disallow specified identifiers
# id-blacklist: "off"
# enforce minimum and maximum identifier lengths
# id-length: "off"
# require identifiers to match a specified regular expression
# id-match: "off"
# enforce consistent indentation
indent: ["error", 4]
# enforce the consistent use of either double or single quotes in JSX attributes
# jsx-quotes: "off"
# enforce consistent spacing between keys and values in object literal properties
key-spacing: "error"
# enforce consistent spacing before and after keywords
keyword-spacing: "error"
# enforce position of line comments
# line-comment-position: "off"
# enforce consistent linebreak style
# linebreak-style: "off"
# require empty lines around comments
# lines-around-comment: "off"
# require or disallow newlines around directives
# lines-around-directive: "off"
# enforce a maximum depth that blocks can be nested
# max-depth: "off"
# enforce a maximum line length
max-len: ["error", 125]
# enforce a maximum file length
# max-lines: "off"
# enforce a maximum depth that callbacks can be nested
# max-nested-callbacks: "off"
# enforce a maximum number of parameters in function definitions
# max-params: "off"
# enforce a maximum number of statements allowed per line
max-statements-per-line: "error"
# enforce a maximum number of statements allowed in function blocks
# max-statements: "off"
# enforce newlines between operands of ternary expressions
# multiline-ternary: "off"
# require constructor function names to begin with a capital letter
new-cap: "error"
# require parentheses when invoking a constructor with no arguments
new-parens: "error"
# require or disallow an empty line after var declarations
# newline-after-var: "off"
# require an empty line before return statements
# newline-before-return: "off"
# require a newline after each call in a method chain
newline-per-chained-call: "off" # recommended by Airbnb
# disallow Array constructors
no-array-constructor: "error"
# disallow bitwise operators
# no-bitwise: "off"
# disallow continue statements
# no-continue: "off"
# disallow inline comments after code
# no-inline-comments: "off"
# disallow if statements as the only statement in else blocks
no-lonely-if: "error"
# disallow mixes of different operators
# no-mixed-operators: "off"
# disallow mixed spaces and tabs for indentation
# no-mixed-spaces-and-tabs: "off"
# disallow multiple empty lines
no-multiple-empty-lines: ["error", { "max": 1, "maxBOF": 0, "maxEOF": 1}]
# disallow negated conditions
no-negated-condition: "error"
# disallow nested ternary expressions
no-nested-ternary: "error"
# disallow Object constructors
no-new-object: "error"
# disallow the unary operators ++ and --
# no-plusplus: "off"
# disallow specified syntax
no-restricted-syntax: "off" # recommended by Airbnb
# Disallow tabs in file
no-tabs: "error"
# disallow ternary operators
# no-ternary: "off"
# disallow trailing whitespace at the end of lines
no-trailing-spaces: ["error", { "skipBlankLines": true }]
# disallow dangling underscores in identifiers
no-underscore-dangle: "error"
# disallow ternary operators when simpler alternatives exist
no-unneeded-ternary: ["error", { "defaultAssignment": false }]
# disallow whitespace before properties
no-whitespace-before-property: "error"
# enforce consistent line breaks inside braces
# object-curly-newline: "off"
# enforce consistent spacing inside braces
object-curly-spacing: ["error", "always"]
# enforce placing object properties on separate lines
object-property-newline: "error"
# require or disallow newlines around var declarations
# one-var-declaration-per-line: "off"
# enforce variables to be declared either together or separately in functions
one-var: ["error", "never"]
# require or disallow assignment operator shorthand where possible
# operator-assignment: "off"
# enforce consistent linebreak style for operators
operator-linebreak: ["error", "before", { "overrides": { "=": "after" } }]
# require or disallow padding within blocks
padded-blocks: "off" # recommended by Airbnb and Google
# require quotes around object literal property names
quote-props: ["error", "consistent-as-needed"]
# enforce the consistent use of either backticks, double, or single quotes
quotes: ["error", "single", { "avoidEscape": true }]
# require JSDoc comments
require-jsdoc: "off" # recommended by Google
# enforce consistent spacing before and after semicolons
semi-spacing: "error"
# require or disallow semicolons instead of ASI
semi: "error"
# requires object keys to be sorted
# sort-keys: "off"
# require variables within the same declaration block to be sorted
# sort-vars: "off"
# enforce consistent spacing before blocks
space-before-blocks: "error"
# enforce consistent spacing before function definition opening parenthesis
space-before-function-paren: ["error", "never"]
# enforce consistent spacing inside parentheses
space-in-parens: "error"
# require spacing around operators
space-infix-ops: "error"
# enforce consistent spacing before or after unary operators
space-unary-ops: "error"
# enforce consistent spacing after the // or /* in a comment
spaced-comment: ["error", "always"]
# require or disallow Unicode BOM
# unicode-bom: "off"
# require parenthesis around regex literals
# wrap-regex: "off"