eslint-config-seekingalpha-base 4.63.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.0.0 - 2021-12-18
4
+ - [deps] update `eslint` to version `8.5.0`
5
+ - [deps] update `eslint-plugin-promise` to version `6.0.0`
6
+ - [breaking] enable `prefer-object-has-own` rule
7
+ - [breaking] enable `no-unused-private-class-members` rule
8
+
9
+ ## 4.66.0 - 2021-12-02
10
+ - [deps] update `eslint-plugin-promise` to version `5.2.0`
11
+
12
+ ## 4.65.0 - 2021-11-22
13
+ - [deps] update `eslint-plugin-unicorn` to version `39.0.0`
14
+ - [breaking] enable `unicorn/no-await-expression-member` rule
15
+ - [breaking] enable `unicorn/prefer-code-point` rule
16
+
17
+ ## 4.64.0 - 2021-11-10
18
+ - [deps] update `eslint-plugin-unicorn` to version `38.0.1`
19
+ - [deps] update `eslint-plugin-import` to version `2.25.3`
20
+
3
21
  ## 4.63.0 - 2021-11-07
4
22
  - [deps] update `eslint-plugin-unicorn` to version `38.0.0`
5
23
  - [breaking] enable `unicorn/no-empty-file` rule
package/README.md CHANGED
@@ -6,7 +6,7 @@ This package includes the shareable ESLint config used by [SeekingAlpha](https:/
6
6
 
7
7
  Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/):
8
8
 
9
- npm install eslint@7.32.0 eslint-plugin-array-func@3.1.7 eslint-plugin-import@2.25.2 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@5.1.1 eslint-plugin-unicorn@38.0.0 --save-dev
9
+ npm install eslint@8.5.0 eslint-plugin-array-func@3.1.7 eslint-plugin-import@2.25.3 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.0.0 eslint-plugin-unicorn@39.0.0 --save-dev
10
10
 
11
11
  Install SeekingAlpha shareable ESLint:
12
12
 
package/index.js CHANGED
@@ -23,7 +23,7 @@ module.exports = {
23
23
  ],
24
24
 
25
25
  parserOptions: {
26
- ecmaVersion: 6,
26
+ ecmaVersion: 12,
27
27
  sourceType: 'module',
28
28
  ecmaFeatures: {
29
29
  impliedStrict: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-seekingalpha-base",
3
- "version": "4.63.0",
3
+ "version": "5.0.0",
4
4
  "description": "SeekingAlpha's sharable base ESLint config",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -48,20 +48,20 @@
48
48
  "node": ">= 14"
49
49
  },
50
50
  "peerDependencies": {
51
- "eslint": "7.32.0",
51
+ "eslint": "8.5.0",
52
52
  "eslint-plugin-array-func": "3.1.7",
53
- "eslint-plugin-import": "2.25.2",
53
+ "eslint-plugin-import": "2.25.3",
54
54
  "eslint-plugin-no-use-extend-native": "0.5.0",
55
- "eslint-plugin-promise": "5.1.1",
56
- "eslint-plugin-unicorn": "38.0.0"
55
+ "eslint-plugin-promise": "6.0.0",
56
+ "eslint-plugin-unicorn": "39.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "eslint": "7.32.0",
60
- "eslint-find-rules": "3.6.1",
59
+ "eslint": "8.5.0",
60
+ "eslint-find-rules": "4.0.0",
61
61
  "eslint-plugin-array-func": "3.1.7",
62
- "eslint-plugin-import": "2.25.2",
62
+ "eslint-plugin-import": "2.25.3",
63
63
  "eslint-plugin-no-use-extend-native": "0.5.0",
64
- "eslint-plugin-promise": "5.1.1",
65
- "eslint-plugin-unicorn": "38.0.0"
64
+ "eslint-plugin-promise": "6.0.0",
65
+ "eslint-plugin-unicorn": "39.0.0"
66
66
  }
67
67
  }
@@ -1,12 +1,9 @@
1
1
  module.exports = {
2
2
 
3
3
  extends: [
4
- './possible-errors.js',
5
- './best-practices.js',
6
- './strict-mode.js',
7
- './variables.js',
8
- './stylistic-issues.js',
9
- './ecma-script-6.js',
4
+ './possible-problems.js',
5
+ './suggestions.js',
6
+ './layout-and-formatting.js',
10
7
  ],
11
8
 
12
9
  };
@@ -1,9 +1,9 @@
1
1
  const config = require('../config');
2
2
 
3
- // https://eslint.org/docs/rules/#stylistic-issues
4
-
5
3
  module.exports = {
6
4
 
5
+ // https://eslint.org/docs/rules/#layout-formatting
6
+
7
7
  rules: {
8
8
 
9
9
  // https://eslint.org/docs/rules/array-bracket-newline
@@ -24,45 +24,33 @@ module.exports = {
24
24
  // https://eslint.org/docs/rules/array-element-newline
25
25
  'array-element-newline': 'off',
26
26
 
27
- // https://eslint.org/docs/rules/block-spacing
28
- 'block-spacing': [
27
+ // https://eslint.org/docs/rules/arrow-parens
28
+ 'arrow-parens': [
29
29
  'error',
30
30
  'always',
31
31
  ],
32
32
 
33
- // https://eslint.org/docs/rules/brace-style
34
- 'brace-style': [
33
+ // https://eslint.org/docs/rules/arrow-spacing
34
+ 'arrow-spacing': [
35
35
  'error',
36
- '1tbs',
37
36
  {
38
- allowSingleLine: false,
37
+ before: true,
38
+ after: true,
39
39
  },
40
40
  ],
41
41
 
42
- // https://eslint.org/docs/rules/camelcase
43
- camelcase: [
42
+ // https://eslint.org/docs/rules/block-spacing
43
+ 'block-spacing': [
44
44
  'error',
45
- {
46
- properties: 'never',
47
- ignoreDestructuring: false,
48
- },
45
+ 'always',
49
46
  ],
50
47
 
51
- // https://eslint.org/docs/rules/capitalized-comments
52
- 'capitalized-comments': [
53
- 'off',
54
- 'never',
48
+ // https://eslint.org/docs/rules/brace-style
49
+ 'brace-style': [
50
+ 'error',
51
+ '1tbs',
55
52
  {
56
- line: {
57
- ignorePattern: '.*',
58
- ignoreInlineComments: true,
59
- ignoreConsecutiveComments: true,
60
- },
61
- block: {
62
- ignorePattern: '.*',
63
- ignoreInlineComments: true,
64
- ignoreConsecutiveComments: true,
65
- },
53
+ allowSingleLine: false,
66
54
  },
67
55
  ],
68
56
 
@@ -113,10 +101,10 @@ module.exports = {
113
101
  'never',
114
102
  ],
115
103
 
116
- // https://eslint.org/docs/rules/consistent-this
117
- 'consistent-this': [
104
+ // https://eslint.org/docs/rules/dot-location
105
+ 'dot-location': [
118
106
  'error',
119
- 'that',
107
+ 'property',
120
108
  ],
121
109
 
122
110
  // https://eslint.org/docs/rules/eol-last
@@ -131,34 +119,6 @@ module.exports = {
131
119
  'never',
132
120
  ],
133
121
 
134
- // https://eslint.org/docs/rules/func-name-matching
135
- 'func-name-matching': [
136
- 'error',
137
- 'always',
138
- {
139
- considerPropertyDescriptor: true,
140
- includeCommonJSModuleExports: true,
141
- },
142
- ],
143
-
144
- /*
145
- * https://eslint.org/docs/rules/func-names
146
- * TODO enable when needed?
147
- */
148
- 'func-names': [
149
- 'off',
150
- 'always',
151
- ],
152
-
153
- // https://eslint.org/docs/rules/func-style
154
- 'func-style': [
155
- 'error',
156
- 'expression',
157
- {
158
- allowArrowFunctions: true,
159
- },
160
- ],
161
-
162
122
  /*
163
123
  * TODO Enable when fixed for arrow functions
164
124
  * https://eslint.org/docs/rules/function-call-argument-newline
@@ -171,22 +131,15 @@ module.exports = {
171
131
  'consistent',
172
132
  ],
173
133
 
174
- // https://eslint.org/docs/rules/id-blacklist
175
- 'id-denylist': 'off',
176
-
177
- // https://eslint.org/docs/rules/id-length
178
- 'id-length': [
134
+ // https://eslint.org/docs/rules/generator-star-spacing
135
+ 'generator-star-spacing': [
179
136
  'error',
180
137
  {
181
- max: config.idLengthMax,
182
- properties: 'always',
183
- exceptions: [],
138
+ before: false,
139
+ after: true,
184
140
  },
185
141
  ],
186
142
 
187
- // https://eslint.org/docs/rules/id-match
188
- 'id-match': 'off',
189
-
190
143
  // https://eslint.org/docs/rules/implicit-arrow-linebreak
191
144
  'implicit-arrow-linebreak': [
192
145
  'error',
@@ -305,12 +258,6 @@ module.exports = {
305
258
  },
306
259
  ],
307
260
 
308
- // https://eslint.org/docs/rules/max-depth
309
- 'max-depth': [
310
- 'error',
311
- config.maxDepth,
312
- ],
313
-
314
261
  // https://eslint.org/docs/rules/max-len
315
262
  'max-len': [
316
263
  'error',
@@ -328,45 +275,6 @@ module.exports = {
328
275
  },
329
276
  ],
330
277
 
331
- // https://eslint.org/docs/rules/max-lines
332
- 'max-lines': [
333
- 'off',
334
- {
335
- max: config.maxLinesMax,
336
- skipBlankLines: true,
337
- skipComments: true,
338
- },
339
- ],
340
-
341
- // https://eslint.org/docs/rules/max-lines-per-function
342
- 'max-lines-per-function': [
343
- 'error',
344
- {
345
- max: config.maxLinesPerFunctionMax,
346
- skipBlankLines: true,
347
- skipComments: true,
348
- IIFEs: true,
349
- },
350
- ],
351
-
352
- // https://eslint.org/docs/rules/max-nested-callbacks
353
- 'max-nested-callbacks': [
354
- 'error',
355
- config.maxNestedCallbacks,
356
- ],
357
-
358
- // https://eslint.org/docs/rules/max-params
359
- 'max-params': [
360
- 'error',
361
- config.maxParams,
362
- ],
363
-
364
- // https://eslint.org/docs/rules/max-statements
365
- 'max-statements': [
366
- 'error',
367
- config.maxStatements,
368
- ],
369
-
370
278
  // https://eslint.org/docs/rules/max-statements-per-line
371
279
  'max-statements-per-line': [
372
280
  'error',
@@ -375,30 +283,12 @@ module.exports = {
375
283
  },
376
284
  ],
377
285
 
378
- // https://eslint.org/docs/rules/multiline-comment-style
379
- 'multiline-comment-style': [
380
- 'error',
381
- 'starred-block',
382
- ],
383
-
384
286
  // https://eslint.org/docs/rules/multiline-ternary
385
287
  'multiline-ternary': [
386
288
  'error',
387
289
  'never',
388
290
  ],
389
291
 
390
- // https://eslint.org/docs/rules/new-cap
391
- 'new-cap': [
392
- 'error',
393
- {
394
- newIsCap: true, // eslint-disable-line unicorn/no-keyword-prefix
395
- newIsCapExceptions: [], // eslint-disable-line unicorn/no-keyword-prefix
396
- capIsNew: false,
397
- capIsNewExceptions: [],
398
- properties: true,
399
- },
400
- ],
401
-
402
292
  // https://eslint.org/docs/rules/new-parens
403
293
  'new-parens': 'error',
404
294
 
@@ -410,71 +300,27 @@ module.exports = {
410
300
  },
411
301
  ],
412
302
 
413
- // https://eslint.org/docs/rules/no-array-constructor
414
- 'no-array-constructor': 'error',
415
-
416
- // https://eslint.org/docs/rules/no-bitwise
417
- 'no-bitwise': 'error',
418
-
419
- // https://eslint.org/docs/rules/no-continue
420
- 'no-continue': 'error',
421
-
422
- // https://eslint.org/docs/rules/no-inline-comments
423
- 'no-inline-comments': 'off',
424
-
425
- // https://eslint.org/docs/rules/no-lonely-if
426
- 'no-lonely-if': 'error',
427
-
428
- // https://eslint.org/docs/rules/no-mixed-operators
429
- 'no-mixed-operators': [
430
- 'error',
431
- {
432
- groups: [
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
- 'in',
466
- 'instanceof',
467
- ],
468
- ],
469
- allowSamePrecedence: true,
303
+ // https://eslint.org/docs/rules/no-extra-parens
304
+ 'no-extra-parens': [
305
+ 'error',
306
+ 'all',
307
+ {
308
+ conditionalAssign: false,
309
+ nestedBinaryExpressions: false,
310
+ returnAssign: false,
311
+ ignoreJSX: 'all',
312
+ enforceForArrowConditionals: false,
313
+ enforceForSequenceExpressions: false,
314
+ enforceForNewInMemberExpressions: false,
315
+ enforceForFunctionPrototypeMethods: false,
470
316
  },
471
317
  ],
472
318
 
473
319
  // https://eslint.org/docs/rules/no-mixed-spaces-and-tabs
474
320
  'no-mixed-spaces-and-tabs': 'error',
475
321
 
476
- // https://eslint.org/docs/rules/no-multi-assign
477
- 'no-multi-assign': 'error',
322
+ // https://eslint.org/docs/rules/no-multi-spaces
323
+ 'no-multi-spaces': 'error',
478
324
 
479
325
  // https://eslint.org/docs/rules/no-multiple-empty-lines
480
326
  'no-multiple-empty-lines': [
@@ -486,49 +332,9 @@ module.exports = {
486
332
  },
487
333
  ],
488
334
 
489
- // https://eslint.org/docs/rules/no-negated-condition
490
- 'no-negated-condition': 'error',
491
-
492
- // https://eslint.org/docs/rules/no-nested-ternary
493
- 'no-nested-ternary': 'error',
494
-
495
- // https://eslint.org/docs/rules/no-new-object
496
- 'no-new-object': 'error',
497
-
498
- // https://eslint.org/docs/rules/no-plusplus
499
- 'no-plusplus': 'error',
500
-
501
- // https://eslint.org/docs/rules/no-restricted-syntax
502
- 'no-restricted-syntax': [
503
- 'error',
504
- {
505
- selector: 'CallExpression[callee.name="setTimeout"][arguments.length!=2]',
506
- message: 'setTimeout must always be invoked with two arguments.',
507
- },
508
- {
509
- selector: 'ForInStatement',
510
- message: 'Use Object.(keys || values) instead',
511
- },
512
- {
513
- selector: 'LabeledStatement',
514
- message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
515
- },
516
- {
517
- selector: 'WithStatement',
518
- message: 'Do not use with DOT',
519
- },
520
- {
521
- selector: 'BinaryExpression[operator="in"]',
522
- message: 'use prototype.hasOwnProperty() instead',
523
- },
524
- ],
525
-
526
335
  // https://eslint.org/docs/rules/no-tabs
527
336
  'no-tabs': 'error',
528
337
 
529
- // https://eslint.org/docs/rules/no-ternary
530
- 'no-ternary': 'off',
531
-
532
338
  // https://eslint.org/docs/rules/no-trailing-space
533
339
  'no-trailing-spaces': [
534
340
  'error',
@@ -538,25 +344,6 @@ module.exports = {
538
344
  },
539
345
  ],
540
346
 
541
- // https://eslint.org/docs/rules/no-underscore-dangle
542
- 'no-underscore-dangle': [
543
- 'error',
544
- {
545
- allow: [],
546
- allowAfterThis: false,
547
- allowAfterSuper: false,
548
- enforceInMethodNames: false,
549
- },
550
- ],
551
-
552
- // https://eslint.org/docs/rules/no-unneeded-ternary
553
- 'no-unneeded-ternary': [
554
- 'error',
555
- {
556
- defaultAssignment: false,
557
- },
558
- ],
559
-
560
347
  // https://eslint.org/docs/rules/no-whitespace-before-property
561
348
  'no-whitespace-before-property': 'error',
562
349
 
@@ -614,24 +401,6 @@ module.exports = {
614
401
  },
615
402
  ],
616
403
 
617
- // https://eslint.org/docs/rules/one-var
618
- 'one-var': [
619
- 'error',
620
- 'never',
621
- ],
622
-
623
- // https://eslint.org/docs/rules/one-var-declaration-per-line
624
- 'one-var-declaration-per-line': [
625
- 'error',
626
- 'initializations',
627
- ],
628
-
629
- // https://eslint.org/docs/rules/operator-assignment
630
- 'operator-assignment': [
631
- 'error',
632
- 'never',
633
- ],
634
-
635
404
  // https://eslint.org/docs/rules/operator-linebreak
636
405
  'operator-linebreak': [
637
406
  'error',
@@ -690,23 +459,6 @@ module.exports = {
690
459
  },
691
460
  ],
692
461
 
693
- // https://eslint.org/docs/rules/prefer-exponentiation-operator
694
- 'prefer-exponentiation-operator': 'error',
695
-
696
- // https://eslint.org/docs/rules/prefer-object-spread
697
- 'prefer-object-spread': 'error',
698
-
699
- // https://eslint.org/docs/rules/quote-props.html
700
- 'quote-props': [
701
- 'error',
702
- 'as-needed',
703
- {
704
- keywords: false,
705
- unnecessary: true,
706
- numbers: false,
707
- },
708
- ],
709
-
710
462
  // https://eslint.org/docs/rules/quotes
711
463
  quotes: [
712
464
  'error',
@@ -717,6 +469,12 @@ module.exports = {
717
469
  },
718
470
  ],
719
471
 
472
+ // https://eslint.org/docs/rules/rest-spread-spacing
473
+ 'rest-spread-spacing': [
474
+ 'error',
475
+ 'never',
476
+ ],
477
+
720
478
  // https://eslint.org/docs/rules/semi
721
479
  semi: [
722
480
  'error',
@@ -738,24 +496,6 @@ module.exports = {
738
496
  'last',
739
497
  ],
740
498
 
741
- // https://eslint.org/docs/rules/sort-keys
742
- 'sort-keys': [
743
- 'off',
744
- 'asc',
745
- {
746
- caseSensitive: false,
747
- natural: true,
748
- },
749
- ],
750
-
751
- // https://eslint.org/docs/rules/sort-vars
752
- 'sort-vars': [
753
- 'off',
754
- {
755
- ignoreCase: true,
756
- },
757
- ],
758
-
759
499
  // https://eslint.org/docs/rules/space-before-blocks
760
500
  'space-before-blocks': 'error',
761
501
 
@@ -788,12 +528,6 @@ module.exports = {
788
528
  },
789
529
  ],
790
530
 
791
- // https://eslint.org/docs/rules/spaced-comment
792
- 'spaced-comment': [
793
- 'error',
794
- 'always',
795
- ],
796
-
797
531
  // https://eslint.org/docs/rules/switch-colon-spacing
798
532
  'switch-colon-spacing': [
799
533
  'error',
@@ -803,6 +537,9 @@ module.exports = {
803
537
  },
804
538
  ],
805
539
 
540
+ // https://eslint.org/docs/rules/template-curly-spacing
541
+ 'template-curly-spacing': 'error',
542
+
806
543
  // https://eslint.org/docs/rules/template-tag-spacing
807
544
  'template-tag-spacing': [
808
545
  'error',
@@ -815,8 +552,23 @@ module.exports = {
815
552
  'never',
816
553
  ],
817
554
 
555
+ // https://eslint.org/docs/rules/wrap-iife.html
556
+ 'wrap-iife': [
557
+ 'error',
558
+ 'outside',
559
+ {
560
+ functionPrototypeMethods: false,
561
+ },
562
+ ],
563
+
818
564
  // https://eslint.org/docs/rules/wrap-regex
819
565
  'wrap-regex': 'error',
820
- },
821
566
 
567
+ // https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js
568
+ 'yield-star-spacing': [
569
+ 'error',
570
+ 'after',
571
+ ],
572
+
573
+ },
822
574
  };