Bug 1257246: Update eslint rules for eslint 2. r=MattN
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 05 Apr 2016 11:33:12 -0700
changeset 349011 09680d0b42ac693951425f85c9279156a3bbf44a
parent 349010 5bb356209841e4450efa4456bb08b68cbaf4fe9e
child 349012 4a108098012bf930f133f5ef582f559671fc89b5
push id14989
push userdtownsend@mozilla.com
push dateFri, 08 Apr 2016 20:09:09 +0000
reviewersMattN
bugs1257246
milestone48.0a1
Bug 1257246: Update eslint rules for eslint 2. r=MattN Rename the rules that ESLint 2 no longer supports to the new names. Ignore the microformat test suite as it is external code. MozReview-Commit-ID: BgIxFERjHp1
.eslintignore
toolkit/.eslintrc
--- a/.eslintignore
+++ b/.eslintignore
@@ -188,16 +188,17 @@ toolkit/components/workerloader/tests/mo
 
 # Tests old non-star function generators
 toolkit/modules/tests/xpcshell/test_task.js
 
 # Not yet updated
 toolkit/components/osfile/**
 
 # External code:
+toolkit/components/microformats/test/**
 toolkit/components/reader/Readability.js
 toolkit/components/reader/JSDOMParser.js
 
 # Uses preprocessing
 toolkit/content/widgets/videocontrols.xml
 toolkit/content/widgets/wizard.xml
 toolkit/components/jsdownloads/src/DownloadIntegration.jsm
 toolkit/components/search/nsSearchService.js
--- a/toolkit/.eslintrc
+++ b/toolkit/.eslintrc
@@ -38,16 +38,19 @@
     // "generator-star-spacing": [2, {"before": false, "after": true}],
 
     // Two space indent
     // "indent": [2, 2, { "SwitchCase": 1 }],
 
     // Space after colon not before in property declarations
     // "key-spacing": [2, { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
 
+    // Require spaces before and after keywords
+    // "keyword-spacing": 2,
+
     // Unix linebreaks
     "linebreak-style": [2, "unix"],
 
     // Always require parenthesis for new calls
     // "new-parens": 2,
 
     // Use [] instead of Array()
     // "no-array-constructor": 2,
@@ -158,37 +161,28 @@
     // "no-use-before-define": [2, "nofunc"],
 
     // No using with
     "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
     // "space-before-blocks": 2,
 
     // Never use spaces before function parentheses
     // "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }],
 
-    // Require spaces before finally, catch, etc.
-    // "space-before-keywords": [2, "always"],
-
     // No space padding in parentheses
     // "space-in-parens": [2, "never"],
 
     // Require spaces around operators
     // "space-infix-ops": 2,
 
-    // Require spaces after return, throw and case
-    // "space-return-throw-case": 2,
-
     // ++ and -- should not need spacing
     // "space-unary-ops": [2, { "words": true, "nonwords": false }],
 
     // No comparisons to NaN
     "use-isnan": 2,
 
     // Only check typeof against valid results
     "valid-typeof": 2,