Browse Source

Merge "Upgraded eslint to 2.4.0"

Jenkins 3 years ago
parent
commit
4ac471faf4
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
@@ -367,6 +379,10 @@ rules:
367 379
   # http://eslint.org/docs/rules/no-script-url
368 380
   no-script-url: 2
369 381
 
382
+  # Disallow assignments where both sides are exactly the same
383
+  # http://eslint.org/docs/rules/no-self-assign
384
+  no-self-assign: 0
385
+
370 386
   # Disallow comparisons where both sides are exactly the same
371 387
   # http://eslint.org/docs/rules/no-self-compare
372 388
   no-self-compare: 2
@@ -379,10 +395,18 @@ rules:
379 395
   # http://eslint.org/docs/rules/no-throw-literal
380 396
   no-throw-literal: 2
381 397
 
398
+  # disallow unmodified conditions of loops
399
+  # http://eslint.org/docs/rules/no-unmodified-loop-condition
400
+  no-unmodified-loop-condition: 0
401
+
382 402
   # Disallow usage of expressions in statement position
383 403
   # http://eslint.org/docs/rules/no-unused-expressions
384 404
   no-unused-expressions: 2
385 405
 
406
+  # disallow unused labels
407
+  # http://eslint.org/docs/rules/no-unused-labels
408
+  no-unused-labels: 0
409
+
386 410
   # disallow unnecessary .call() and .apply()
387 411
   # http://eslint.org/docs/rules/no-useless-call
388 412
   no-useless-call: 0
@@ -457,6 +481,10 @@ rules:
457 481
   # http://eslint.org/docs/rules/no-label-var
458 482
   no-label-var: 2
459 483
 
484
+  # restrict usage of specified global variables
485
+  # http://eslint.org/docs/rules/no-restricted-globals
486
+  no-restricted-globals: 0
487
+
460 488
   # Disallow shadowing of names such as arguments
461 489
   # http://eslint.org/docs/rules/no-shadow-restricted-names
462 490
   no-shadow-restricted-names: 2
@@ -583,6 +611,10 @@ rules:
583 611
   # http://eslint.org/docs/rules/func-style
584 612
   func-style: 0
585 613
 
614
+  # blacklist certain identifiers to prevent them being used
615
+  # http://eslint.org/docs/rules/id-blacklist
616
+  id-blacklist: 0
617
+
586 618
   # this option enforces minimum and maximum identifier lengths (variable names, property names...)
587 619
   # http://eslint.org/docs/rules/id-length
588 620
   id-length: 0
@@ -606,6 +638,10 @@ rules:
606 638
   # http://eslint.org/docs/rules/key-spacing
607 639
   key-spacing: 0
608 640
 
641
+  # enforce spacing before and after keywords
642
+  # http://eslint.org/docs/rules/keyword-spacing
643
+  keyword-spacing: 0
644
+
609 645
   # Enforces empty lines around comments
610 646
   # http://eslint.org/docs/rules/lines-around-comment
611 647
   lines-around-comment: 0
@@ -634,6 +670,14 @@ rules:
634 670
   # http://eslint.org/docs/rules/newline-after-var
635 671
   newline-after-var: 0
636 672
 
673
+  # require newline before return statement
674
+  # http://eslint.org/docs/rules/newline-before-return
675
+  newline-before-return: 0
676
+
677
+  # enforce newline after each call when chaining the calls
678
+  # http://eslint.org/docs/rules/newline-per-chained-call
679
+  newline-per-chained-call: 0
680
+
637 681
   # Disallow use of the Array constructor
638 682
   # http://eslint.org/docs/rules/no-array-constructor
639 683
   no-array-constructor: 0
@@ -696,6 +740,10 @@ rules:
696 740
   # http://eslint.org/docs/rules/no-unneeded-ternary
697 741
   no-unneeded-ternary: 2
698 742
 
743
+  # disallow whitespace before properties
744
+  # http://eslint.org/docs/rules/no-whitespace-before-property
745
+  no-whitespace-before-property: 0
746
+
699 747
   # Require or disallow padding inside curly braces
700 748
   # http://eslint.org/docs/rules/object-curly-spacing
701 749
   object-curly-spacing: 0
@@ -707,6 +755,10 @@ rules:
707 755
     - uninitialized: "always"
708 756
       initialized: "never"
709 757
 
758
+  # require or disallow an newline around variable declarations
759
+  # http://eslint.org/docs/rules/one-var-declaration-per-line
760
+  one-var-declaration-per-line: 0
761
+
710 762
   # Prevent assignment operator shorthand where possible
711 763
   # http://eslint.org/docs/rules/operator-assignment
712 764
   operator-assignment:
@@ -742,6 +794,10 @@ rules:
742 794
     - before: false
743 795
       after: true
744 796
 
797
+  # sort import declarations within module
798
+  # http://eslint.org/docs/rules/sort-imports
799
+  sort-imports: 0
800
+
745 801
   # Require or disallow use of semicolons instead of ASI
746 802
   # http://eslint.org/docs/rules/semi
747 803
   semi:
@@ -752,14 +808,6 @@ rules:
752 808
   # http://eslint.org/docs/rules/sort-vars
753 809
   sort-vars: 0
754 810
 
755
-  # Require a space after certain keywords
756
-  # http://eslint.org/docs/rules/space-after-keywords
757
-  space-after-keywords: 2
758
-
759
-  # Require a space before certain keywords
760
-  # http://eslint.org/docs/rules/space-before-keywords
761
-  space-before-keywords: 0
762
-
763 811
   # require or disallow space before blocks
764 812
   # http://eslint.org/docs/rules/space-before-blocks
765 813
   space-before-blocks:
@@ -782,10 +830,6 @@ rules:
782 830
   # http://eslint.org/docs/rules/space-infix-ops
783 831
   space-infix-ops: 2
784 832
 
785
-  # Require a space after return, throw, and case
786
-  # http://eslint.org/docs/rules/space-return-throw-case
787
-  space-return-throw-case: 2
788
-
789 833
   # Require or disallow spaces before/after unary operators (words on by default, nonwords)
790 834
   # http://eslint.org/docs/rules/space-unary-ops
791 835
   space-unary-ops:
@@ -825,14 +869,14 @@ rules:
825 869
   # http://eslint.org/docs/rules/generator-star-spacing
826 870
   generator-star-spacing: 0
827 871
 
828
-  # disallow arrow functions where a condition is expected
829
-  # http://eslint.org/docs/rules/no-arrow-condition
830
-  no-arrow-condition: 0
831
-
832 872
   # disallow modifying variables of class declarations
833 873
   # http://eslint.org/docs/rules/no-class-assign
834 874
   no-class-assign: 0
835 875
 
876
+  # disallow arrow functions where they could be confused with comparisons
877
+  # http://eslint.org/docs/rules/no-confusing-arrow
878
+  no-confusing-arrow: 0
879
+
836 880
   # disallow modifying variables that are declared using const
837 881
   # http://eslint.org/docs/rules/no-const-assign
838 882
   no-const-assign: 0
@@ -841,10 +885,22 @@ rules:
841 885
   # http://eslint.org/docs/rules/no-dupe-class-members
842 886
   no-dupe-class-members: 0
843 887
 
888
+  # disallow use of the new operator with the Symbol object
889
+  # http://eslint.org/docs/rules/no-new-symbol
890
+  no-new-symbol: 0
891
+
892
+  # restrict usage of specified modules when loaded by import declaration
893
+  # http://eslint.org/docs/rules/no-restricted-imports
894
+  no-restricted-imports: 0
895
+
844 896
   # disallow use of this/super before calling super() in constructors
845 897
   # http://eslint.org/docs/rules/no-this-before-super
846 898
   no-this-before-super: 0
847 899
 
900
+  # disallow unnecessary constructor
901
+  # http://eslint.org/docs/rules/no-useless-constructor
902
+  no-useless-constructor: 0
903
+
848 904
   # require let or const instead of var
849 905
   # http://eslint.org/docs/rules/no-var
850 906
   no-var: 0
@@ -869,6 +925,10 @@ rules:
869 925
   # http://eslint.org/docs/rules/prefer-reflect
870 926
   prefer-reflect: 0
871 927
 
928
+  # suggest using the rest parameters instead of arguments
929
+  # http://eslint.org/docs/rules/prefer-rest-params
930
+  prefer-rest-params: 0
931
+
872 932
   # suggest using template literals instead of strings concatenation
873 933
   # http://eslint.org/docs/rules/prefer-template
874 934
   prefer-template: 0
@@ -877,6 +937,14 @@ rules:
877 937
   # http://eslint.org/docs/rules/require-yield
878 938
   require-yield: 0
879 939
 
940
+  # enforce spacing around embedded expressions of template strings
941
+  # http://eslint.org/docs/rules/template-curly-spacing
942
+  template-curly-spacing: 0
943
+
944
+  # enforce spacing around the * in yield* expressions
945
+  # http://eslint.org/docs/rules/yield-star-spacing
946
+  yield-star-spacing: 0
947
+
880 948
   #############################################################################
881 949
   # Legacy
882 950
   #############################################################################

+ 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