Bug 1342459 - Enable no-undef on browser/base, and clean up unnecessary no-undef references. r=mossop
authorMark Banner <standard8@mozilla.com>
Mon, 03 Apr 2017 11:46:56 +0100
changeset 558337 ca3083864db1402b0129f4248407c5e2a2ca6512
parent 558336 88f6f749466f7b2f5926f14bee4cfd91f14152d4
child 558338 81bcd8301759c8bd9d0805c7c66e150a4371cb85
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +0000
reviewersmossop
bugs1342459
milestone55.0a1
Bug 1342459 - Enable no-undef on browser/base, and clean up unnecessary no-undef references. r=mossop MozReview-Commit-ID: KVrAnAjMD1E
browser/base/.eslintrc.js
browser/base/content/browser-social.js
browser/components/contextualidentity/test/browser/.eslintrc.js
browser/components/customizableui/content/.eslintrc.js
browser/components/extensions/.eslintrc.js
browser/components/migration/.eslintrc.js
browser/components/nsBrowserContentHandler.js
browser/extensions/formautofill/.eslintrc.js
browser/modules/test/browser/browser_ContentSearch.js
security/manager/ssl/tests/.eslintrc.js
security/manager/ssl/tests/mochitest/browser/.eslintrc.js
security/manager/ssl/tests/mochitest/mixedcontent/.eslintrc.js
security/manager/ssl/tests/mochitest/stricttransportsecurity/.eslintrc.js
security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
security/manager/ssl/tests/unit/.eslintrc.js
security/manager/tools/.eslintrc.js
storage/.eslintrc.js
toolkit/components/extensions/.eslintrc.js
toolkit/components/narrate/.eslintrc.js
toolkit/components/passwordmgr/.eslintrc.js
toolkit/components/passwordmgr/test/.eslintrc.js
toolkit/components/windowcreator/test/.eslintrc.js
toolkit/components/windowcreator/tests/unit/.eslintrc.js
toolkit/components/windowwatcher/test/.eslintrc.js
toolkit/modules/addons/.eslintrc.js
toolkit/modules/subprocess/.eslintrc.js
toolkit/mozapps/extensions/.eslintrc.js
toolkit/mozapps/extensions/test/browser/.eslintrc.js
toolkit/mozapps/extensions/test/mochitest/.eslintrc.js
toolkit/mozapps/extensions/test/xpcshell/.eslintrc.js
deleted file mode 100644
--- a/browser/base/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
-  rules: {
-    "no-undef": "off"
-  }
-};
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -1,14 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* eslint-env mozilla/browser-window */
-/* eslint no-undef: "error" */
 /* global OpenGraphBuilder:false, DynamicResizeWatcher:false */
 
 // the "exported" symbols
 var SocialUI,
     SocialShare,
     SocialActivationListener;
 
 (function() {
--- a/browser/components/contextualidentity/test/browser/.eslintrc.js
+++ b/browser/components/contextualidentity/test/browser/.eslintrc.js
@@ -1,11 +1,7 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/browser-test"
-  ],
-
-  "rules": {
-    "no-undef": "error"
-  }
+  ]
 };
--- a/browser/components/customizableui/content/.eslintrc.js
+++ b/browser/components/customizableui/content/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = {  // eslint-disable-line no-undef
+module.exports = {
   "env": {
     "mozilla/browser-window": true,
   },
 
   "plugins": [
     "mozilla",
   ]
 };
--- a/browser/components/extensions/.eslintrc.js
+++ b/browser/components/extensions/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = {  // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../../toolkit/components/extensions/.eslintrc.js",
 
   "globals": {
     "EventEmitter": true,
     "IconDetails": true,
     "Tab": true,
     "TabContext": true,
     "Window": true,
--- a/browser/components/migration/.eslintrc.js
+++ b/browser/components/migration/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "../../.eslintrc.js"
   ],
 
   "globals": {
     "Components": true,
     "dump": true,
     "Iterator": true
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -1,14 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* eslint no-undef:2 */
-
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "LaterRun",
                                   "resource:///modules/LaterRun.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
                                   "resource://gre/modules/PrivateBrowsingUtils.jsm");
--- a/browser/extensions/formautofill/.eslintrc.js
+++ b/browser/extensions/formautofill/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../.eslintrc.js",
 
   "globals": {
     "addMessageListener": false,
     "Components": true,
     "dump": true,
     "removeMessageListener": false,
     "sendAsyncMessage": false,
--- a/browser/modules/test/browser/browser_ContentSearch.js
+++ b/browser/modules/test/browser/browser_ContentSearch.js
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const TEST_MSG = "ContentSearchTest";
 const CONTENT_SEARCH_MSG = "ContentSearch";
 const TEST_CONTENT_SCRIPT_BASENAME = "contentSearch.js";
 
 var gMsgMan;
-/* eslint no-undef:"error" */
 /* import-globals-from ../../../components/search/test/head.js */
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/browser/components/search/test/head.js",
   this);
 
 let originalEngine = Services.search.currentEngine;
 
 add_task(function* setup() {
--- a/security/manager/ssl/tests/.eslintrc.js
+++ b/security/manager/ssl/tests/.eslintrc.js
@@ -1,8 +1,8 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "rules": {
     // Disallow non-top level |var| declarations.
     "mozilla/var-only-at-top-level": "error"
   }
 };
--- a/security/manager/ssl/tests/mochitest/browser/.eslintrc.js
+++ b/security/manager/ssl/tests/mochitest/browser/.eslintrc.js
@@ -1,5 +1,5 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "plugin:mozilla/browser-test"
 };
--- a/security/manager/ssl/tests/mochitest/mixedcontent/.eslintrc.js
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/.eslintrc.js
@@ -1,9 +1,9 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "plugin:mozilla/mochitest-test",
   "rules": {
 	// Boilerplate runTest and afterNavigationtest calls use opening braces on newline.
     "brace-style": "off"
   }
 };
--- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/.eslintrc.js
+++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/.eslintrc.js
@@ -1,9 +1,9 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   // mochitest-chrome tests also exist in this directory, but don't appear to
   // use anything not also available to plain mochitests. Since plain mochitests
   // are the majority, we take the safer option and only extend the
   // mochitest-plain eslintrc file.
   "extends": "plugin:mozilla/mochitest-test"
 };
--- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
+++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
@@ -8,20 +8,16 @@
   <title>opens additional content that should be converted to https</title>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 
   <script class="testbody" type="text/javascript">
   "use strict";
 
-  // We define |content| as a global as a hack to prevent use of |content|
-  // inside a ContentTask tripping ESLint no-undef checks.
-  /* global content */
-
   SimpleTest.waitForExplicitFinish();
 
   const Cc = Components.classes;
   const Ci = Components.interfaces;
   const Cu = Components.utils;
   const STSPATH =
     "tests/security/manager/ssl/tests/mochitest/stricttransportsecurity";
   const NUM_TEST_FRAMES = 4;
--- a/security/manager/ssl/tests/unit/.eslintrc.js
+++ b/security/manager/ssl/tests/unit/.eslintrc.js
@@ -1,5 +1,5 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "plugin:mozilla/xpcshell-test"
 };
--- a/security/manager/tools/.eslintrc.js
+++ b/security/manager/tools/.eslintrc.js
@@ -1,9 +1,9 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     // JS files in this folder are commonly xpcshell scripts where |arguments|
     // is defined in the global scope.
     "arguments": false
   }
 };
--- a/storage/.eslintrc.js
+++ b/storage/.eslintrc.js
@@ -1,11 +1,7 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/recommended"
   ],
-
-  rules: {
-    "no-undef": "error"
-  }
 };
--- a/toolkit/components/extensions/.eslintrc.js
+++ b/toolkit/components/extensions/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../.eslintrc.js",
 
   "env": {
     "browser": false,
   },
 
   "globals": {
     "Cc": true,
--- a/toolkit/components/narrate/.eslintrc.js
+++ b/toolkit/components/narrate/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "../../.eslintrc.js"
   ],
 
   "globals": {
     "Components": true,
     "dump": true,
     "Iterator": true
--- a/toolkit/components/passwordmgr/.eslintrc.js
+++ b/toolkit/components/passwordmgr/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../.eslintrc.js",
   "rules": {
     // Require spacing around =>
     "arrow-spacing": "error",
 
     // No newline before open brace for a block
     "brace-style": ["error", "1tbs", {"allowSingleLine": true}],
 
--- a/toolkit/components/passwordmgr/test/.eslintrc.js
+++ b/toolkit/components/passwordmgr/test/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/mochitest-test",
     "plugin:mozilla/chrome-test"
   ],
   "rules": {
     "brace-style": "off",
     "no-undef": "off",
     "no-unused-vars": "off",
--- a/toolkit/components/windowcreator/test/.eslintrc.js
+++ b/toolkit/components/windowcreator/test/.eslintrc.js
@@ -1,9 +1,9 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/browser-test",
     "plugin:mozilla/chrome-test",
     "plugin:mozilla/mochitest-test",
   ]
 };
--- a/toolkit/components/windowcreator/tests/unit/.eslintrc.js
+++ b/toolkit/components/windowcreator/tests/unit/.eslintrc.js
@@ -1,7 +1,7 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test",
   ]
 };
--- a/toolkit/components/windowwatcher/test/.eslintrc.js
+++ b/toolkit/components/windowwatcher/test/.eslintrc.js
@@ -1,9 +1,9 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/browser-test",
     "plugin:mozilla/chrome-test",
     "plugin:mozilla/mochitest-test",
   ]
 };
--- a/toolkit/modules/addons/.eslintrc.js
+++ b/toolkit/modules/addons/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../components/extensions/.eslintrc.js",
 
   "globals": {
     "addEventListener": false,
     "addMessageListener": false,
     "removeEventListener": false,
     "sendAsyncMessage": false,
     "AddonManagerPermissions": false,
--- a/toolkit/modules/subprocess/.eslintrc.js
+++ b/toolkit/modules/subprocess/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": "../../components/extensions/.eslintrc.js",
 
   "env": {
     "worker": true,
   },
 
   "globals": {
     "ChromeWorker": false,
--- a/toolkit/mozapps/extensions/.eslintrc.js
+++ b/toolkit/mozapps/extensions/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "rules": {
     // Warn about cyclomatic complexity in functions.
     // XXX Bug 1326071 - This should be reduced down - probably to 20 or to
     // be removed & synced with the mozilla/recommended value.
     "complexity": ["error", {"max": 60}],
 
     // No using undeclared variables
     "no-undef": "error",
--- a/toolkit/mozapps/extensions/test/browser/.eslintrc.js
+++ b/toolkit/mozapps/extensions/test/browser/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/browser-test"
   ],
 
   "rules": {
     "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS|end_test)$"}],
   }
 };
--- a/toolkit/mozapps/extensions/test/mochitest/.eslintrc.js
+++ b/toolkit/mozapps/extensions/test/mochitest/.eslintrc.js
@@ -1,7 +1,7 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/mochitest-test"
   ]
 };
--- a/toolkit/mozapps/extensions/test/xpcshell/.eslintrc.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/.eslintrc.js
@@ -1,10 +1,10 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
   ],
   "rules": {
     "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS|end_test)$"}],
   }
 };