Bug 1231728 - Enable no-dupe-args, no-dupe-keys, no-duplicate-case, no-obj-calls, no-with rules globally, no-redlecare and consistent-return in browser. r=Mossop
authorFelipe Gomes <felipc@gmail.com>
Thu, 10 Dec 2015 14:34:44 -0500
changeset 276068 54bb45fa0e7d9c56032fa4af7b5c69e7eb0d90f2
parent 276067 5c4c80beee8bacc1a3b1b294b010312c68100a8f
child 276069 f4ce7427347e3b54b6155bca555df5487d6b63ce
push id16608
push userfelipc@gmail.com
push dateThu, 10 Dec 2015 19:39:43 +0000
treeherderfx-team@11c67a7b46b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1231728
milestone45.0a1
Bug 1231728 - Enable no-dupe-args, no-dupe-keys, no-duplicate-case, no-obj-calls, no-with rules globally, no-redlecare and consistent-return in browser. r=Mossop
browser/.eslintrc
toolkit/.eslintrc
--- a/browser/.eslintrc
+++ b/browser/.eslintrc
@@ -1,5 +1,13 @@
 {
   "extends": [
     "../toolkit/.eslintrc"
-  ]
+  ],
+
+  "rules": {
+    // No redeclaring variables
+    "no-redeclare": 2,
+
+    // Functions must always return something or nothing
+    "consistent-return": 2,
+  }
 }
--- a/toolkit/.eslintrc
+++ b/toolkit/.eslintrc
@@ -48,23 +48,23 @@
 
     // Always require parenthesis for new calls
     // "new-parens": 2,
 
     // Use [] instead of Array()
     // "no-array-constructor": 2,
 
     // No duplicate arguments in function declarations
-    // "no-dupe-args": 2,
+    "no-dupe-args": 2,
 
     // No duplicate keys in object declarations
-    // "no-dupe-keys": 2,
+    "no-dupe-keys": 2,
 
     // No duplicate cases in switch statements
-    // "no-duplicate-case": 2,
+    "no-duplicate-case": 2,
 
     // No labels
     // "no-labels": 2,
 
     // If an if block ends with a return no need for an else block
     // "no-else-return": 2,
 
     // No empty statements
@@ -111,17 +111,17 @@
 
     // Nested ternary statements are confusing
     // "no-nested-ternary": 2,
 
     // Use {} instead of new Object()
     // "no-new-object": 2,
 
     // No Math() or JSON()
-    // "no-obj-calls": 2,
+    "no-obj-calls": 2,
 
     // No octal literals
     // "no-octal": 2,
 
     // No redeclaring variables
     // "no-redeclare": 2,
 
     // No unnecessary comparisons
@@ -153,17 +153,17 @@
 
     // No declaring variables that are never used
     // "no-unused-vars": [2, {"vars": "all", "args": "none"}],
 
     // No using variables before defined
     // "no-use-before-define": [2, "nofunc"],
 
     // No using with
-    // "no-with": 2,
+    "no-with": 2,
 
     // Always require semicolon at end of statement
     // "semi": [2, "always"],
 
     // Require space after keywords
     // "space-after-keywords": 2,
 
     // Require space before blocks