Bug 1257246: Update eslint rules for eslint 2. r?MattN draft
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 05 Apr 2016 11:33:12 -0700
changeset 348092 8c525fd007baf867a6c016cd28e346655b9891ff
parent 348091 6fcabf31e086c251d3dd632bcc640392150f6153
child 348093 38d186a8f7b19497a5c9f5d637f58af18de7b23a
child 348099 09cb4b8baa81d7eccb9290d065b0888a2267d459
push id14747
push userdtownsend@mozilla.com
push dateWed, 06 Apr 2016 16:46:59 +0000
reviewersMattN
bugs1257246
milestone48.0a1
Bug 1257246: Update eslint rules for eslint 2. r?MattN For now this means turning off keyword-spacing. This replaced the old space-before-keywords and space-after-keywords but for some reason now notices that our spacing after some keywords, particularly catch, switch and while is very inconsistent. Correcting one way or another is time consuming because eslint's auto-fixing can't work on html or xbl files. 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,