Bug 1324184 - Stop using deprecated rules in PSM ESLint config. r?keeler draft
authorCykesiopka <cykesiopka.bmo@gmail.com>
Wed, 21 Dec 2016 00:43:05 +0800
changeset 451552 3ba547fb64c95517a1dbde62c9f21ef36e36af56
parent 451551 c59499ae612da18687d3053136e4a33ba8dc0a95
child 451553 a7cc0f9e413adba41e6d61b2f0fbfcc46880399d
push id39223
push usercykesiopka.bmo@gmail.com
push dateTue, 20 Dec 2016 16:44:45 +0000
reviewerskeeler
bugs1324184
milestone53.0a1
Bug 1324184 - Stop using deprecated rules in PSM ESLint config. r?keeler The following rules were deprecated in ESLint v3.3.0 with the following replacements: 1. no-native-reassign -> no-global-assign 2. no-spaced-func -> func-call-spacing MozReview-Commit-ID: IF0gRCR9l9p
security/manager/.eslintrc.js
--- a/security/manager/.eslintrc.js
+++ b/security/manager/.eslintrc.js
@@ -24,16 +24,19 @@ module.exports = { // eslint-disable-lin
     "consistent-return": "error",
 
     // Require braces around blocks that start a new line
     "curly": ["error", "multi-line"],
 
     // Always require a trailing EOL
     "eol-last": "error",
 
+    // No spaces between function name and parentheses.
+    "func-call-spacing": ["error", "never"],
+
     // Require function* name()
     "generator-star-spacing": ["error", {"before": false, "after": true}],
 
     // Space after colon not before in property declarations
     "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
 
     // Require spaces around keywords
     "keyword-spacing": "error",
@@ -103,16 +106,19 @@ module.exports = { // eslint-disable-lin
     "no-extra-boolean-cast": "error",
 
     // No double semicolon
     "no-extra-semi": "error",
 
     // No overwriting defined functions
     "no-func-assign": "error",
 
+    // No reassigning native JS objects or read only globals.
+    "no-global-assign": "error",
+
     // No invalid regular expressions
     "no-invalid-regexp": "error",
 
     // No odd whitespace characters
     "no-irregular-whitespace": "error",
 
     // No single if block inside an else block
     "no-lonely-if": "error",
@@ -123,19 +129,16 @@ module.exports = { // eslint-disable-lin
     // No unnecessary spacing
     "no-multi-spaces": ["error", { "exceptions": {
       "AssignmentExpression": true,
       "VariableDeclarator": true,
       "ArrayExpression": true,
       "ObjectExpression": true
     }}],
 
-    // No reassigning native JS objects
-    "no-native-reassign": "error",
-
     // Nested ternary statements are confusing
     "no-nested-ternary": "error",
 
     // Use {} instead of new Object()
     "no-new-object": "error",
 
     // No Math() or JSON()
     "no-obj-calls": "error",
@@ -153,19 +156,16 @@ module.exports = { // eslint-disable-lin
     "no-self-assign": "error",
 
     // No unnecessary comparisons
     "no-self-compare": "error",
 
     // No declaring variables that hide things like arguments
     "no-shadow-restricted-names": "error",
 
-    // No spaces between function name and parentheses
-    "no-spaced-func": "error",
-
     // Disallow sparse arrays, eg. let arr = [,,"error"].
     "no-sparse-arrays": "error",
 
     // Disallow throwing literals (eg. |throw "error"| instead of
     // |throw new Error("error")|)
     "no-throw-literal": "error",
 
     // No trailing whitespace