Bug 1229859 - Massively reduce the number of eslint errors in devtools by ignoring lib files, adding missing .eslintrc files and making some rules be warnings; r=Mossop
authorPatrick Brosset <pbrosset@mozilla.com>
Thu, 10 Dec 2015 15:46:32 -0500
changeset 297737 c857a46087009d56163839700e1b4484fb672613
parent 297736 11c67a7b46b5158bd48a7216ab45f124a71d4794
child 297738 760f2be9b5490933e5c64dfab9e39b620b57c945
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1229859
milestone45.0a1
Bug 1229859 - Massively reduce the number of eslint errors in devtools by ignoring lib files, adding missing .eslintrc files and making some rules be warnings; r=Mossop
.eslintignore
devtools/.eslintrc
devtools/client/aboutdebugging/test/.eslintrc
devtools/client/commandline/test/.eslintrc
devtools/client/jsonview/test/.eslintrc
devtools/client/memory/test/browser/.eslintrc
devtools/client/memory/test/unit/.eslintrc
devtools/shared/apps/tests/unit/.eslintrc
devtools/shared/heapsnapshot/tests/unit/.eslintrc
devtools/shared/security/tests/unit/.eslintrc
devtools/shared/tests/browser/.eslintrc
devtools/shared/transport/tests/unit/.eslintrc
devtools/shared/webconsole/test/unit/.eslintrc
devtools/shared/worker/tests/browser/.eslintrc
--- a/.eslintignore
+++ b/.eslintignore
@@ -123,31 +123,35 @@ browser/extensions/loop/standalone/dist
 # devtools/ exclusions
 # Ignore d3
 devtools/client/shared/d3.js
 devtools/client/webaudioeditor/lib/dagre-d3.js
 
 # Ignore codemirror
 devtools/client/sourceeditor/codemirror/*.js
 devtools/client/sourceeditor/codemirror/**/*.js
+devtools/client/sourceeditor/test/codemirror/*
 
 # Ignore jquery test libs
 devtools/client/markupview/test/lib_*
 
 # Ignore pre-processed files
 devtools/client/framework/toolbox-process-window.js
 devtools/client/performance/system.js
 devtools/client/webide/webide-prefs.js
 
 # Ignore various libs
 devtools/shared/jsbeautify/*
 devtools/shared/acorn/*
-devtools/shared/tern/*
+devtools/client/sourceeditor/tern/*
 devtools/shared/pretty-fast/*
 devtools/shared/sourcemap/*
+devtools/shared/qrcode/decoder/*
+devtools/shared/qrcode/encoder/*
+devtools/client/shared/vendor/*
 
 # mobile/android/ exclusions
 mobile/android/chrome/content
 mobile/android/tests/
 
 # Uses `#filter substitution`
 mobile/android/b2gdroid/app/b2gdroid.js
 mobile/android/app/mobile.js
--- a/devtools/.eslintrc
+++ b/devtools/.eslintrc
@@ -31,26 +31,26 @@
     "mozilla/no-cpows-in-tests": 1,
     "mozilla/var-only-at-top-level": 1,
 
     // Disallow using variables outside the blocks they are defined (especially
     // since only let and const are used, see "no-var").
     "block-scoped-var": 2,
     // Enforce one true brace style (opening brace on the same line) and avoid
     // start and end braces on the same line.
-    "brace-style": [2, "1tbs", {"allowSingleLine": false}],
+    "brace-style": [1, "1tbs", {"allowSingleLine": false}],
     // Require camel case names
-    "camelcase": 2,
+    "camelcase": 1,
     // Allow trailing commas for easy list extension.  Having them does not
     // impair readability, but also not required either.
     "comma-dangle": 0,
     // Enforce spacing before and after comma
-    "comma-spacing": [2, {"before": false, "after": true}],
+    "comma-spacing": [1, {"before": false, "after": true}],
     // Enforce one true comma style.
-    "comma-style": [2, "last"],
+    "comma-style": [1, "last"],
     // Warn about cyclomatic complexity in functions.
     "complexity": 1,
     // Require return statements to either always or never specify values.
     "consistent-return": 2,
     // Don't warn for inconsistent naming when capturing this (not so important
     // with auto-binding fat arrow functions).
     "consistent-this": 0,
     // Enforce curly brace conventions for all control statements.
@@ -79,17 +79,17 @@
     "generator-star": 0,
     // Enforce the spacing around the * in generator functions.
     "generator-star-spacing": [1, "after"],
     // Deprecated, will be removed in 1.0.
     "global-strict": 0,
     // Only useful in a node environment.
     "handle-callback-err": 0,
     // Tab width.
-    "indent": [2, 2, {"SwitchCase": 1}],
+    "indent": [1, 2, {"SwitchCase": 1}],
     // Enforces spacing between keys and values in object literal properties.
     "key-spacing": [1, {"beforeColon": false, "afterColon": true}],
     // Allow mixed 'LF' and 'CRLF' as linebreaks.
     "linebreak-style": 0,
     // Don't enforce the maximum depth that blocks can be nested. The complexity
     // rule is a better rule to check this.
     "max-depth": 0,
     // Maximum length of a line.
@@ -163,17 +163,17 @@
     "no-extend-native": 2,
     // Disallow unnecessary function binding.
     "no-extra-bind": 2,
     // Disallow double-negation boolean casts in a boolean context.
     "no-extra-boolean-cast": 2,
     // Allow unnecessary parentheses, as they may make the code more readable.
     "no-extra-parens": 0,
     // Disallow unnecessary semicolons.
-    "no-extra-semi": 2,
+    "no-extra-semi": 1,
     // Deprecated, will be removed in 1.0.
     "no-extra-strict": 0,
     // Disallow fallthrough of case statements, except if there is a comment.
     "no-fallthrough": 2,
     // Allow the use of leading or trailing decimal points in numeric literals.
     "no-floating-decimal": 0,
     // Disallow comments inline after code.
     "no-inline-comments": 1,
new file mode 100644
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../.eslintrc.mochitests"
+}
--- a/devtools/client/commandline/test/.eslintrc
+++ b/devtools/client/commandline/test/.eslintrc
@@ -1,4 +1,8 @@
 {
   // Extend from the shared list of defined globals for mochitests.
-  "extends": "../../../.eslintrc.mochitests"
+  "extends": "../../../.eslintrc.mochitests",
+  "globals": {
+    "helpers": true,
+    "assert": true
+  }
 }
new file mode 100644
--- /dev/null
+++ b/devtools/client/jsonview/test/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../.eslintrc.mochitests"
+}
new file mode 100644
--- /dev/null
+++ b/devtools/client/memory/test/browser/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../../.eslintrc.mochitests"
+}
new file mode 100644
--- /dev/null
+++ b/devtools/client/memory/test/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
new file mode 100644
--- /dev/null
+++ b/devtools/shared/apps/tests/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the common devtools xpcshell eslintrc config.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/shared/heapsnapshot/tests/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the common devtools xpcshell eslintrc config.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/shared/security/tests/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the common devtools xpcshell eslintrc config.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/shared/tests/browser/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../.eslintrc.mochitests"
+}
new file mode 100644
--- /dev/null
+++ b/devtools/shared/transport/tests/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the common devtools xpcshell eslintrc config.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/shared/webconsole/test/unit/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the common devtools xpcshell eslintrc config.
+  "extends": "../../../../.eslintrc.xpcshell"
+}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/shared/worker/tests/browser/.eslintrc
@@ -0,0 +1,4 @@
+{
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../../.eslintrc.mochitests"
+}