From 5bc48bf279d2fb7d1995a614b2ec0809f5696f78 Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Wed, 16 Mar 2016 07:34:04 -0700 Subject: [PATCH] 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 --- .eslintrc | 106 ++++++++++++++++++++++++++++++++++++++++++--------- package.json | 4 +- 2 files changed, 89 insertions(+), 21 deletions(-) diff --git a/.eslintrc b/.eslintrc index e8c2a1f..b3856f2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -183,6 +183,10 @@ rules: # http://eslint.org/docs/rules/accessor-pairs accessor-pairs: 2 + # Enforces return statements in callbacks of array’s methods + # http://eslint.org/docs/rules/array-callback-return + array-callback-return: 0 + # Treat var statements as if they were block scoped # http://eslint.org/docs/rules/block-scoped-var block-scoped-var: 2 @@ -241,9 +245,9 @@ rules: # http://eslint.org/docs/rules/no-else-return no-else-return: 0 - # Disallow use of labels for anything other then loops and switches - # http://eslint.org/docs/rules/no-empty-label - no-empty-label: 2 + # Disallow use of empty functions + # http://eslint.org/docs/rules/no-empty-function + no-empty-function: 0 # disallow use of empty destructuring patterns # http://eslint.org/docs/rules/no-empty-pattern @@ -265,6 +269,10 @@ rules: # http://eslint.org/docs/rules/no-extra-bind no-extra-bind: 2 + # disallow unnecessary labels + # http://eslint.org/docs/rules/no-extra-label + no-extra-label: 0 + # Disallow fallthrough of case statements # http://eslint.org/docs/rules/no-fallthrough no-fallthrough: 2 @@ -277,6 +285,10 @@ rules: # http://eslint.org/docs/rules/no-implicit-coercion no-implicit-coercion: 0 + # disallow var and named functions in global scope + # http://eslint.org/docs/rules/no-implicit-globals + no-implicit-globals: 0 + # Disallow use of eval()-like methods # http://eslint.org/docs/rules/no-implied-eval no-implied-eval: 2 @@ -365,6 +377,10 @@ rules: # http://eslint.org/docs/rules/no-script-url no-script-url: 2 + # Disallow assignments where both sides are exactly the same + # http://eslint.org/docs/rules/no-self-assign + no-self-assign: 0 + # Disallow comparisons where both sides are exactly the same # http://eslint.org/docs/rules/no-self-compare no-self-compare: 2 @@ -377,10 +393,18 @@ rules: # http://eslint.org/docs/rules/no-throw-literal no-throw-literal: 2 + # disallow unmodified conditions of loops + # http://eslint.org/docs/rules/no-unmodified-loop-condition + no-unmodified-loop-condition: 0 + # Disallow usage of expressions in statement position # http://eslint.org/docs/rules/no-unused-expressions no-unused-expressions: 2 + # disallow unused labels + # http://eslint.org/docs/rules/no-unused-labels + no-unused-labels: 0 + # disallow unnecessary .call() and .apply() # http://eslint.org/docs/rules/no-useless-call no-useless-call: 0 @@ -455,6 +479,10 @@ rules: # http://eslint.org/docs/rules/no-label-var no-label-var: 2 + # restrict usage of specified global variables + # http://eslint.org/docs/rules/no-restricted-globals + no-restricted-globals: 0 + # Disallow shadowing of names such as arguments # http://eslint.org/docs/rules/no-shadow-restricted-names no-shadow-restricted-names: 2 @@ -578,6 +606,10 @@ rules: # http://eslint.org/docs/rules/func-style func-style: 0 + # blacklist certain identifiers to prevent them being used + # http://eslint.org/docs/rules/id-blacklist + id-blacklist: 0 + # this option enforces minimum and maximum identifier lengths (variable names, property names...) # http://eslint.org/docs/rules/id-length id-length: 0 @@ -601,6 +633,10 @@ rules: # http://eslint.org/docs/rules/key-spacing key-spacing: 0 + # enforce spacing before and after keywords + # http://eslint.org/docs/rules/keyword-spacing + keyword-spacing: 0 + # Enforces empty lines around comments # http://eslint.org/docs/rules/lines-around-comment lines-around-comment: 0 @@ -629,6 +665,14 @@ rules: # http://eslint.org/docs/rules/newline-after-var newline-after-var: 0 + # require newline before return statement + # http://eslint.org/docs/rules/newline-before-return + newline-before-return: 0 + + # enforce newline after each call when chaining the calls + # http://eslint.org/docs/rules/newline-per-chained-call + newline-per-chained-call: 0 + # Disallow use of the Array constructor # http://eslint.org/docs/rules/no-array-constructor no-array-constructor: 0 @@ -691,6 +735,10 @@ rules: # http://eslint.org/docs/rules/no-unneeded-ternary no-unneeded-ternary: 2 + # disallow whitespace before properties + # http://eslint.org/docs/rules/no-whitespace-before-property + no-whitespace-before-property: 0 + # Require or disallow padding inside curly braces # http://eslint.org/docs/rules/object-curly-spacing object-curly-spacing: 0 @@ -702,6 +750,10 @@ rules: - uninitialized: "always" initialized: "never" + # require or disallow an newline around variable declarations + # http://eslint.org/docs/rules/one-var-declaration-per-line + one-var-declaration-per-line: 0 + # Prevent assignment operator shorthand where possible # http://eslint.org/docs/rules/operator-assignment operator-assignment: @@ -737,6 +789,10 @@ rules: - before: false after: true + # sort import declarations within module + # http://eslint.org/docs/rules/sort-imports + sort-imports: 0 + # Require or disallow use of semicolons instead of ASI # http://eslint.org/docs/rules/semi semi: @@ -747,14 +803,6 @@ rules: # http://eslint.org/docs/rules/sort-vars sort-vars: 0 - # Require a space after certain keywords - # http://eslint.org/docs/rules/space-after-keywords - space-after-keywords: 2 - - # Require a space before certain keywords - # http://eslint.org/docs/rules/space-before-keywords - space-before-keywords: 0 - # require or disallow space before blocks # http://eslint.org/docs/rules/space-before-blocks space-before-blocks: @@ -777,10 +825,6 @@ rules: # http://eslint.org/docs/rules/space-infix-ops space-infix-ops: 2 - # Require a space after return, throw, and case - # http://eslint.org/docs/rules/space-return-throw-case - space-return-throw-case: 2 - # Require or disallow spaces before/after unary operators (words on by default, nonwords) # http://eslint.org/docs/rules/space-unary-ops space-unary-ops: @@ -820,14 +864,14 @@ rules: # http://eslint.org/docs/rules/generator-star-spacing generator-star-spacing: 0 - # disallow arrow functions where a condition is expected - # http://eslint.org/docs/rules/no-arrow-condition - no-arrow-condition: 0 - # disallow modifying variables of class declarations # http://eslint.org/docs/rules/no-class-assign no-class-assign: 0 + # disallow arrow functions where they could be confused with comparisons + # http://eslint.org/docs/rules/no-confusing-arrow + no-confusing-arrow: 0 + # disallow modifying variables that are declared using const # http://eslint.org/docs/rules/no-const-assign no-const-assign: 0 @@ -836,10 +880,22 @@ rules: # http://eslint.org/docs/rules/no-dupe-class-members no-dupe-class-members: 0 + # disallow use of the new operator with the Symbol object + # http://eslint.org/docs/rules/no-new-symbol + no-new-symbol: 0 + + # restrict usage of specified modules when loaded by import declaration + # http://eslint.org/docs/rules/no-restricted-imports + no-restricted-imports: 0 + # disallow use of this/super before calling super() in constructors # http://eslint.org/docs/rules/no-this-before-super no-this-before-super: 0 + # disallow unnecessary constructor + # http://eslint.org/docs/rules/no-useless-constructor + no-useless-constructor: 0 + # require let or const instead of var # http://eslint.org/docs/rules/no-var no-var: 0 @@ -864,6 +920,10 @@ rules: # http://eslint.org/docs/rules/prefer-reflect prefer-reflect: 0 + # suggest using the rest parameters instead of arguments + # http://eslint.org/docs/rules/prefer-rest-params + prefer-rest-params: 0 + # suggest using template literals instead of strings concatenation # http://eslint.org/docs/rules/prefer-template prefer-template: 0 @@ -872,6 +932,14 @@ rules: # http://eslint.org/docs/rules/require-yield require-yield: 0 + # enforce spacing around embedded expressions of template strings + # http://eslint.org/docs/rules/template-curly-spacing + template-curly-spacing: 0 + + # enforce spacing around the * in yield* expressions + # http://eslint.org/docs/rules/yield-star-spacing + yield-star-spacing: 0 + ############################################################################# # Legacy ############################################################################# diff --git a/package.json b/package.json index e2d10aa..8054cbb 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ }, "homepage": "https://wiki.openstack.org/wiki/QA", "peerDependencies": { - "eslint": "^1.10.3" + "eslint": "^2.4.0" }, "devDependencies": { - "eslint": "1.10.3", + "eslint": "2.4.0", "jasmine": "2.3.1" }, "dependencies": {