Browse Source

Upgraded eslint to 2.4.0

This upgrades the eslint version to 2.4.0, removes zombie rules,
and ensures that all new rules are disabled.

Change-Id: I6249663f8e226c5fa2739481b4c79625f94c7eb5
Michael Krotscheck 3 years ago
parent
commit
5bc48bf279
2 changed files with 89 additions and 21 deletions
  1. 87
    19
      .eslintrc
  2. 2
    2
      package.json

+ 87
- 19
.eslintrc View File

@@ -183,6 +183,10 @@ rules:
183 183
   # http://eslint.org/docs/rules/accessor-pairs
184 184
   accessor-pairs: 2
185 185
 
186
+  # Enforces return statements in callbacks of array’s methods
187
+  # http://eslint.org/docs/rules/array-callback-return
188
+  array-callback-return: 0
189
+
186 190
   # Treat var statements as if they were block scoped
187 191
   # http://eslint.org/docs/rules/block-scoped-var
188 192
   block-scoped-var: 2
@@ -241,9 +245,9 @@ rules:
241 245
   # http://eslint.org/docs/rules/no-else-return
242 246
   no-else-return: 0
243 247
 
244
-  # Disallow use of labels for anything other then loops and switches
245
-  # http://eslint.org/docs/rules/no-empty-label
246
-  no-empty-label: 2
248
+  # Disallow use of empty functions
249
+  # http://eslint.org/docs/rules/no-empty-function
250
+  no-empty-function: 0
247 251
 
248 252
   # disallow use of empty destructuring patterns
249 253
   # http://eslint.org/docs/rules/no-empty-pattern
@@ -265,6 +269,10 @@ rules:
265 269
   # http://eslint.org/docs/rules/no-extra-bind
266 270
   no-extra-bind: 2
267 271
 
272
+  # disallow unnecessary labels
273
+  # http://eslint.org/docs/rules/no-extra-label
274
+  no-extra-label: 0
275
+
268 276
   # Disallow fallthrough of case statements
269 277
   # http://eslint.org/docs/rules/no-fallthrough
270 278
   no-fallthrough: 2
@@ -277,6 +285,10 @@ rules:
277 285
   # http://eslint.org/docs/rules/no-implicit-coercion
278 286
   no-implicit-coercion: 0
279 287
 
288
+  # disallow var and named functions in global scope
289
+  # http://eslint.org/docs/rules/no-implicit-globals
290
+  no-implicit-globals: 0
291
+
280 292
   # Disallow use of eval()-like methods
281 293
   # http://eslint.org/docs/rules/no-implied-eval
282 294
   no-implied-eval: 2
@@ -365,6 +377,10 @@ rules:
365 377
   # http://eslint.org/docs/rules/no-script-url
366 378
   no-script-url: 2
367 379
 
380
+  # Disallow assignments where both sides are exactly the same
381
+  # http://eslint.org/docs/rules/no-self-assign
382
+  no-self-assign: 0
383
+
368 384
   # Disallow comparisons where both sides are exactly the same
369 385
   # http://eslint.org/docs/rules/no-self-compare
370 386
   no-self-compare: 2
@@ -377,10 +393,18 @@ rules:
377 393
   # http://eslint.org/docs/rules/no-throw-literal
378 394
   no-throw-literal: 2
379 395
 
396
+  # disallow unmodified conditions of loops
397
+  # http://eslint.org/docs/rules/no-unmodified-loop-condition
398
+  no-unmodified-loop-condition: 0
399
+
380 400
   # Disallow usage of expressions in statement position
381 401
   # http://eslint.org/docs/rules/no-unused-expressions
382 402
   no-unused-expressions: 2
383 403
 
404
+  # disallow unused labels
405
+  # http://eslint.org/docs/rules/no-unused-labels
406
+  no-unused-labels: 0
407
+
384 408
   # disallow unnecessary .call() and .apply()
385 409
   # http://eslint.org/docs/rules/no-useless-call
386 410
   no-useless-call: 0
@@ -455,6 +479,10 @@ rules:
455 479
   # http://eslint.org/docs/rules/no-label-var
456 480
   no-label-var: 2
457 481
 
482
+  # restrict usage of specified global variables
483
+  # http://eslint.org/docs/rules/no-restricted-globals
484
+  no-restricted-globals: 0
485
+
458 486
   # Disallow shadowing of names such as arguments
459 487
   # http://eslint.org/docs/rules/no-shadow-restricted-names
460 488
   no-shadow-restricted-names: 2
@@ -578,6 +606,10 @@ rules:
578 606
   # http://eslint.org/docs/rules/func-style
579 607
   func-style: 0
580 608
 
609
+  # blacklist certain identifiers to prevent them being used
610
+  # http://eslint.org/docs/rules/id-blacklist
611
+  id-blacklist: 0
612
+
581 613
   # this option enforces minimum and maximum identifier lengths (variable names, property names...)
582 614
   # http://eslint.org/docs/rules/id-length
583 615
   id-length: 0
@@ -601,6 +633,10 @@ rules:
601 633
   # http://eslint.org/docs/rules/key-spacing
602 634
   key-spacing: 0
603 635
 
636
+  # enforce spacing before and after keywords
637
+  # http://eslint.org/docs/rules/keyword-spacing
638
+  keyword-spacing: 0
639
+
604 640
   # Enforces empty lines around comments
605 641
   # http://eslint.org/docs/rules/lines-around-comment
606 642
   lines-around-comment: 0
@@ -629,6 +665,14 @@ rules:
629 665
   # http://eslint.org/docs/rules/newline-after-var
630 666
   newline-after-var: 0
631 667
 
668
+  # require newline before return statement
669
+  # http://eslint.org/docs/rules/newline-before-return
670
+  newline-before-return: 0
671
+
672
+  # enforce newline after each call when chaining the calls
673
+  # http://eslint.org/docs/rules/newline-per-chained-call
674
+  newline-per-chained-call: 0
675
+
632 676
   # Disallow use of the Array constructor
633 677
   # http://eslint.org/docs/rules/no-array-constructor
634 678
   no-array-constructor: 0
@@ -691,6 +735,10 @@ rules:
691 735
   # http://eslint.org/docs/rules/no-unneeded-ternary
692 736
   no-unneeded-ternary: 2
693 737
 
738
+  # disallow whitespace before properties
739
+  # http://eslint.org/docs/rules/no-whitespace-before-property
740
+  no-whitespace-before-property: 0
741
+
694 742
   # Require or disallow padding inside curly braces
695 743
   # http://eslint.org/docs/rules/object-curly-spacing
696 744
   object-curly-spacing: 0
@@ -702,6 +750,10 @@ rules:
702 750
     - uninitialized: "always"
703 751
       initialized: "never"
704 752
 
753
+  # require or disallow an newline around variable declarations
754
+  # http://eslint.org/docs/rules/one-var-declaration-per-line
755
+  one-var-declaration-per-line: 0
756
+
705 757
   # Prevent assignment operator shorthand where possible
706 758
   # http://eslint.org/docs/rules/operator-assignment
707 759
   operator-assignment:
@@ -737,6 +789,10 @@ rules:
737 789
     - before: false
738 790
       after: true
739 791
 
792
+  # sort import declarations within module
793
+  # http://eslint.org/docs/rules/sort-imports
794
+  sort-imports: 0
795
+
740 796
   # Require or disallow use of semicolons instead of ASI
741 797
   # http://eslint.org/docs/rules/semi
742 798
   semi:
@@ -747,14 +803,6 @@ rules:
747 803
   # http://eslint.org/docs/rules/sort-vars
748 804
   sort-vars: 0
749 805
 
750
-  # Require a space after certain keywords
751
-  # http://eslint.org/docs/rules/space-after-keywords
752
-  space-after-keywords: 2
753
-
754
-  # Require a space before certain keywords
755
-  # http://eslint.org/docs/rules/space-before-keywords
756
-  space-before-keywords: 0
757
-
758 806
   # require or disallow space before blocks
759 807
   # http://eslint.org/docs/rules/space-before-blocks
760 808
   space-before-blocks:
@@ -777,10 +825,6 @@ rules:
777 825
   # http://eslint.org/docs/rules/space-infix-ops
778 826
   space-infix-ops: 2
779 827
 
780
-  # Require a space after return, throw, and case
781
-  # http://eslint.org/docs/rules/space-return-throw-case
782
-  space-return-throw-case: 2
783
-
784 828
   # Require or disallow spaces before/after unary operators (words on by default, nonwords)
785 829
   # http://eslint.org/docs/rules/space-unary-ops
786 830
   space-unary-ops:
@@ -820,14 +864,14 @@ rules:
820 864
   # http://eslint.org/docs/rules/generator-star-spacing
821 865
   generator-star-spacing: 0
822 866
 
823
-  # disallow arrow functions where a condition is expected
824
-  # http://eslint.org/docs/rules/no-arrow-condition
825
-  no-arrow-condition: 0
826
-
827 867
   # disallow modifying variables of class declarations
828 868
   # http://eslint.org/docs/rules/no-class-assign
829 869
   no-class-assign: 0
830 870
 
871
+  # disallow arrow functions where they could be confused with comparisons
872
+  # http://eslint.org/docs/rules/no-confusing-arrow
873
+  no-confusing-arrow: 0
874
+
831 875
   # disallow modifying variables that are declared using const
832 876
   # http://eslint.org/docs/rules/no-const-assign
833 877
   no-const-assign: 0
@@ -836,10 +880,22 @@ rules:
836 880
   # http://eslint.org/docs/rules/no-dupe-class-members
837 881
   no-dupe-class-members: 0
838 882
 
883
+  # disallow use of the new operator with the Symbol object
884
+  # http://eslint.org/docs/rules/no-new-symbol
885
+  no-new-symbol: 0
886
+
887
+  # restrict usage of specified modules when loaded by import declaration
888
+  # http://eslint.org/docs/rules/no-restricted-imports
889
+  no-restricted-imports: 0
890
+
839 891
   # disallow use of this/super before calling super() in constructors
840 892
   # http://eslint.org/docs/rules/no-this-before-super
841 893
   no-this-before-super: 0
842 894
 
895
+  # disallow unnecessary constructor
896
+  # http://eslint.org/docs/rules/no-useless-constructor
897
+  no-useless-constructor: 0
898
+
843 899
   # require let or const instead of var
844 900
   # http://eslint.org/docs/rules/no-var
845 901
   no-var: 0
@@ -864,6 +920,10 @@ rules:
864 920
   # http://eslint.org/docs/rules/prefer-reflect
865 921
   prefer-reflect: 0
866 922
 
923
+  # suggest using the rest parameters instead of arguments
924
+  # http://eslint.org/docs/rules/prefer-rest-params
925
+  prefer-rest-params: 0
926
+
867 927
   # suggest using template literals instead of strings concatenation
868 928
   # http://eslint.org/docs/rules/prefer-template
869 929
   prefer-template: 0
@@ -872,6 +932,14 @@ rules:
872 932
   # http://eslint.org/docs/rules/require-yield
873 933
   require-yield: 0
874 934
 
935
+  # enforce spacing around embedded expressions of template strings
936
+  # http://eslint.org/docs/rules/template-curly-spacing
937
+  template-curly-spacing: 0
938
+
939
+  # enforce spacing around the * in yield* expressions
940
+  # http://eslint.org/docs/rules/yield-star-spacing
941
+  yield-star-spacing: 0
942
+
875 943
   #############################################################################
876 944
   # Legacy
877 945
   #############################################################################

+ 2
- 2
package.json View File

@@ -29,10 +29,10 @@
29 29
   },
30 30
   "homepage": "https://wiki.openstack.org/wiki/QA",
31 31
   "peerDependencies": {
32
-    "eslint": "^1.10.3"
32
+    "eslint": "^2.4.0"
33 33
   },
34 34
   "devDependencies": {
35
-    "eslint": "1.10.3",
35
+    "eslint": "2.4.0",
36 36
     "jasmine": "2.3.1"
37 37
   },
38 38
   "dependencies": {

Loading…
Cancel
Save