Bug 1517664 - Tidy some linting code in mail/components; r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 25 Jan 2019 17:32:10 +1300
changeset 34297 881cf0d594f227667269c03cc35a09959d5f700d
parent 34296 bd2ed7ad33c9714f381b6d8c5d9d8c5f4a1d40d8
child 34298 0a405faf8b1dd4ed743633103fadbdaa93e9d86a
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersaceman
bugs1517664
Bug 1517664 - Tidy some linting code in mail/components; r=aceman
mail/base/content/commandglue.js
mail/base/content/foldersummary.js
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailCommands.js
mail/base/content/mailCore.js
mail/base/content/mailTabs.js
mail/base/content/mailWindowOverlay.js
mail/base/content/nsContextMenu.js
mail/base/content/selectionsummaries.js
mail/base/content/specialTabs.js
mail/base/modules/MailMigrator.jsm
mail/components/accountcreation/content/.eslintrc.js
mail/components/accountcreation/content/MyBadCertHandler.js
mail/components/accountcreation/content/accountConfig.js
mail/components/accountcreation/content/createInBackend.js
mail/components/accountcreation/content/emailWizard.js
mail/components/accountcreation/content/exchangeAutoDiscover.js
mail/components/accountcreation/content/fetchConfig.js
mail/components/accountcreation/content/fetchhttp.js
mail/components/accountcreation/content/guessConfig.js
mail/components/accountcreation/content/readFromXML.js
mail/components/accountcreation/content/sanitizeDatatypes.js
mail/components/accountcreation/content/util.js
mail/components/accountcreation/content/verifyConfig.js
mail/components/activity/modules/autosync.jsm
mail/components/activity/modules/glodaIndexer.jsm
mail/components/activity/modules/moveCopy.jsm
mail/components/activity/modules/pop3Download.jsm
mail/components/activity/modules/sendLater.jsm
mail/components/addrbook/content/.eslintrc.js
mail/components/addrbook/content/abCard.js
mail/components/addrbook/content/abCardView.js
mail/components/addrbook/content/abCommon.js
mail/components/addrbook/content/abContactsPanel.js
mail/components/addrbook/content/abTrees.js
mail/components/addrbook/content/addressbook.js
mail/components/appIdleManager.js
mail/components/compose/content/.eslintrc.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/addressingWidgetOverlay.js
mail/components/preferences/.eslintrc.js
mail/components/preferences/advanced.js
mail/components/preferences/applications.js
mail/components/preferences/compose.js
mail/components/preferences/display.js
mail/components/preferences/downloads.js
mail/components/preferences/general.js
mail/components/preferences/messagestyle.js
mail/components/preferences/privacy.js
mail/components/preferences/security.js
mail/components/preferences/subdialogs.js
mail/extensions/smime/content/msgCompSMIMEOverlay.js
mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
--- a/mail/base/content/commandglue.js
+++ b/mail/base/content/commandglue.js
@@ -3,16 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Command-specific code. This stuff should be called by the widgets
  */
 
 /* import-globals-from folderDisplay.js */
 /* import-globals-from folderPane.js */
+/* import-globals-from mailWindow.js */
+/* import-globals-from msgMail3PaneWindow.js */
 
 var { MailViewConstants } = ChromeUtils.import("resource:///modules/MailViewManager.jsm", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function UpdateMailToolbar(caller) {
   // If we have a transient selection, we shouldn't update the toolbar. We'll
   // update it once we've restored the original selection.
   if ("gRightMouseButtonSavedSelection" in window &&
--- a/mail/base/content/foldersummary.js
+++ b/mail/base/content/foldersummary.js
@@ -1,15 +1,16 @@
 /**
  * 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/. */
 
 /* globals MozXULElement */
 /* import-globals-from folderDisplay.js */
+/* import-globals-from folderPane.js */
 /* import-globals-from ../../../mailnews/base/content/newmailalert.js */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 /**
  * MozFolderSummary displays a listing of NEW mails for the folder in question.
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -8,16 +8,17 @@
  */
 
 /* import-globals-from ../../components/im/content/chat-messenger.js */
 /* import-globals-from commandglue.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from msgViewNavigation.js */
 /* import-globals-from threadPane.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 // Controller object for folder pane
 var FolderPaneController = {
--- a/mail/base/content/mailCommands.js
+++ b/mail/base/content/mailCommands.js
@@ -1,16 +1,17 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 /* import-globals-from commandglue.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mailWindow.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 /**
  * Get the identity that most likely is the best one to use, given the hint.
  * @param identities    nsIArray<nsIMsgIdentity> of identities
  * @param optionalHint  string containing comma separated mailboxes
@@ -158,25 +159,25 @@ function GetMsgKeyFromURI(uri) {
   //   ex : mailbox-message://john%2Edoe@pop.isp.invalid/Drafts#123456?fetchCompleteMessage=true
   //   ex : mailbox-message://john%2Edoe@pop.isp.invalid/Drafts#12345
   // We keep only the part after '#' and before an optional '?'.
   // The regexp expects 'key' to be an integer (a series of digits) : '\d+'.
   let match = /.+#(\d+)/.exec(uri);
   return (match) ? match[1] : null;
 }
 
+/* eslint-disable complexity */
 /**
  * Compose a message.
  *
  * @param type   nsIMsgCompType    Type of composition (new message, reply, draft, etc.)
  * @param format nsIMsgCompFormat  Requested format (plain text, html, default)
  * @param folder nsIMsgFolder      Folder where the original message is stored
  * @param messageArray             Array of messages to process, often only holding one element.
  */
-/* eslint-disable complexity */
 function ComposeMessage(type, format, folder, messageArray) {
   let msgComposeType = Ci.nsIMsgCompType;
   let ignoreQuote = false;
   let msgKey;
   if (messageArray && messageArray.length == 1) {
     msgKey = GetMsgKeyFromURI(messageArray[0]);
     if (msgKey != gMessageDisplay.keyForCharsetOverride) {
       msgWindow.charsetOverride = false;
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -11,16 +11,17 @@
  * Before adding to this file, ask yourself, is this a JS routine that is going
  * to be used by all of the main mail windows?
  */
 
 /* import-globals-from ../../../common/src/customizeToolbar.js */
 /* import-globals-from ../../extensions/mailviews/content/msgViewPickerOverlay.js */
 /* import-globals-from commandglue.js */
 /* import-globals-from mailWindow.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/CharsetMenu.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
--- a/mail/base/content/mailTabs.js
+++ b/mail/base/content/mailTabs.js
@@ -1,15 +1,16 @@
 /* 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/. */
 
 /* import-globals-from commandglue.js */
 /* import-globals-from mail3PaneWindowCommands.js */
 /* import-globals-from mailContextMenus.js */
+/* import-globals-from mailWindow.js */
 /* import-globals-from mailWindowOverlay.js */
 /* import-globals-from messageDisplay.js */
 /* import-globals-from msgMail3PaneWindow.js */
 
 ChromeUtils.import("resource:///modules/MsgHdrSyntheticView.jsm");
 var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -8,16 +8,17 @@
 /* import-globals-from commandglue.js */
 /* import-globals-from contentAreaClick.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mail3PaneWindowCommands.js */
 /* import-globals-from mailCommands.js */
 /* import-globals-from mailContextMenus.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from phishingDetector.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 var { GlodaSyntheticView } = ChromeUtils.import("resource:///modules/gloda/dbview.js", null);
 ChromeUtils.import("resource:///modules/MailConsts.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -2,16 +2,17 @@
  * 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/. */
 
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mailTabs.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from messageDisplay.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
 ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
@@ -441,21 +442,21 @@ nsContextMenu.prototype = {
       "mailContext-sep-undo", "mailContext-sep-clipboard",
       "mailContext-spell-suggestions-separator", "mailContext-spell-separator",
     ];
     mailContextSeparators.forEach(this.hideIfAppropriate, this);
 
     this.checkLastSeparator(this.menu);
   },
 
+  /* eslint-disable complexity */
   /**
    * Set the nsContextMenu properties based on the selected node and
    * its ancestors.
    */
-  /* eslint-disable complexity */
   setTarget(aNode) {
     // Clear any old spellchecking items from the menu, this used to
     // be in the menu hiding code but wasn't getting called in all
     // situations. Here, we can ensure it gets cleaned up any time the
     // menu is shown. Note: must be before uninit because that clears the
     // internal vars
     // We also need to do that before we possibly bail because we just clicked
     // on some XUL node. Otherwise, dictionary choices just accumulate until we
--- a/mail/base/content/selectionsummaries.js
+++ b/mail/base/content/selectionsummaries.js
@@ -1,13 +1,14 @@
 /* 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/. */
 
 /* import-globals-from commandglue.js */
+/* import-globals-from mailWindow.js */
 
 /**
  * Summarize a set of selected messages.  This can either be a single thread or
  * multiple threads.
  *
  * @param aMessageDisplay The MessageDisplayWidget object responsible for
  *                         showing messages.
  */
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -1,14 +1,15 @@
 /* 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/. */
 
 /* import-globals-from ../../../../toolkit/components/printing/content/printUtils.js */
 /* import-globals-from mailWindow.js */
+/* import-globals-from utilityOverlay.js */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
 ChromeUtils.import("resource:///modules/StringBundle.js");
 ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/ExtensionParent.jsm");
--- a/mail/base/modules/MailMigrator.jsm
+++ b/mail/base/modules/MailMigrator.jsm
@@ -80,21 +80,21 @@ var MailMigrator = {
           this._switchDefaultFonts(fonts, encodings);
 
           Services.prefs.setIntPref("mail.font.windows.version", 2);
         }
       }
     }
   },
 
+  /* eslint-disable complexity */
   /**
    * Determine if the UI has been upgraded in a way that requires us to reset
    * some user configuration.  If so, performs the resets.
    */
-  /* eslint-disable complexity */
   _migrateUI() {
     // The code for this was ported from
     // mozilla/browser/components/nsBrowserGlue.js
     const UI_VERSION = 17;
     const MESSENGER_DOCURL = "chrome://messenger/content/messenger.xul";
     const MESSENGERCOMPOSE_DOCURL = "chrome://messenger/content/messengercompose/messengercompose.xul";
     const UI_VERSION_PREF = "mail.ui-rdf.version";
     let currentUIVersion = Services.prefs.getIntPref(UI_VERSION_PREF, 0);
deleted file mode 100644
--- a/mail/components/accountcreation/content/.eslintrc.js
+++ /dev/null
@@ -1,59 +0,0 @@
-"use strict";
-
-module.exports = {
-  "globals": {
-    "Abortable": true,
-    "AccountConfig": true,
-    "AddonInstaller": true,
-    "BadCertHandler": true,
-    "CancelledException": true,
-    "Exception": true,
-    "FetchHTTP": true,
-    "Log4Moz": true,
-    "MailServices": true,
-    "NewMailAccountProvisioner": true,
-    "NotReached": true,
-    "PriorityOrderAbortable": true,
-    "Services": true,
-    "SuccessiveAbortable": true,
-    "TimeoutAbortable": true,
-    "UserCancelledException": true,
-    "alertPrompt": true,
-    "assert": true,
-    "checkIncomingServerAlreadyExists": true,
-    "checkOutgoingServerAlreadyExists": true,
-    "cleanUpHostName": true,
-    "createAccountInBackend": true,
-    "ddump": true,
-    "debugObject": true,
-    "deepCopy": true,
-    "errorWithDebug": true,
-    "fetchConfigForMX": true,
-    "fetchConfigFromDB": true,
-    "fetchConfigFromDisk": true,
-    "fetchConfigFromExchange": true,
-    "fetchConfigFromISP": true,
-    "getStringBundle": true,
-    "guessConfig": true,
-    "isLegalHostName": true,
-    "isLegalHostNameOrIP": true,
-    "isLegalIPAddress": true,
-    "isLegalIPv4Address": true,
-    "isLegalIPv6Address": true,
-    "isLegalLocalIPAddress": true,
-    "kDebug": true,
-    "kMaxPort": true,
-    "kMinPort": true,
-    "logElement": true,
-    "logEvent": true,
-    "logException": true,
-    "logObject": true,
-    "makeCallback": true,
-    "readFromXML": true,
-    "readURLasUTF8": true,
-    "replaceVariables": true,
-    "runAsync": true,
-    "sanitize": true,
-    "verifyConfig": true,
-  },
-};
--- a/mail/components/accountcreation/content/MyBadCertHandler.js
+++ b/mail/components/accountcreation/content/MyBadCertHandler.js
@@ -8,18 +8,17 @@
  * security dialogs from being shown to the user.  We call back to the
  * 'callback' object's method "processCertError" so that it can deal with it as
  * needed (in the case of autoconfig, setting up temporary overrides).
  */
 function BadCertHandler(callback) {
   this._init(callback);
 }
 
-BadCertHandler.prototype =
-{
+BadCertHandler.prototype = {
   _init(callback) {
     this._callback = callback;
   },
 
   // Suppress any certificate errors
   notifyCertProblem(socketInfo, status, targetSite) {
     return this._callback.processCertError(socketInfo, status, targetSite);
   },
--- a/mail/components/accountcreation/content/accountConfig.js
+++ b/mail/components/accountcreation/content/accountConfig.js
@@ -15,33 +15,33 @@
  * new object and returns that, and the caller can copy these
  * values into the object used by the UI.
  *
  * See also
  * <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat>
  * for values stored.
  */
 
+/* import-globals-from emailWizard.js */
+
 function AccountConfig() {
   this.incoming = this.createNewIncoming();
   this.incomingAlternatives = [];
   this.outgoing = this.createNewOutgoing();
   this.outgoingAlternatives = [];
-  this.identity =
-  {
+  this.identity = {
     // displayed real name of user
     realname: "%REALNAME%",
     // email address of user, as shown in From of outgoing mails
     emailAddress: "%EMAILADDRESS%",
   };
   this.inputFields = [];
   this.domains = [];
 }
-AccountConfig.prototype =
-{
+AccountConfig.prototype = {
   // @see createNewIncoming()
   incoming: null,
   // @see createNewOutgoing()
   outgoing: null,
   /**
    * Other servers which can be used instead of |incoming|,
    * in order of decreasing preference.
    * (|incoming| itself should not be included here.)
--- a/mail/components/accountcreation/content/createInBackend.js
+++ b/mail/components/accountcreation/content/createInBackend.js
@@ -1,18 +1,19 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
+/* import-globals-from emailWizard.js */
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 /* eslint-disable complexity */
-
 /**
  * Takes an |AccountConfig| JS object and creates that account in the
  * Thunderbird backend (which also writes it to prefs).
  *
  * @param {AccountConfig} config - The account to create
  * @return {nsIMsgAccount} - the newly created account
  */
 function createAccountInBackend(config) {
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -1,18 +1,35 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/MailServices.jsm");
+/* import-globals-from ../../../../mailnews/base/prefs/content/accountUtils.js */
+/* import-globals-from accountConfig.js */
+/* import-globals-from createInBackend.js */
+/* import-globals-from emailWizard.js */
+/* import-globals-from exchangeAutoDiscover.js */
+/* import-globals-from fetchConfig.js */
+/* import-globals-from fetchhttp.js */
+/* import-globals-from guessConfig.js */
+/* import-globals-from MyBadCertHandler.js */
+/* import-globals-from readFromXML.js */
+/* import-globals-from sanitizeDatatypes.js */
+/* import-globals-from util.js */
+/* import-globals-from verifyConfig.js */
+
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
+ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/OAuth2Providers.jsm");
 
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
+/* globals cleanUpHostName, isLegalHostNameOrIP, kMaxPort, kMinPort */
+ChromeUtils.import("resource:///modules/hostnameUtils.jsm", null);
+
 /**
  * This is the dialog opened by menu File | New account | Mail... .
  *
  * It gets the user's realname, email address and password,
  * and tries to automatically configure the account from that,
  * using various mechanisms. If all fails, the user can enter/edit
  * the config, then we create the account.
  *
@@ -30,17 +47,16 @@ ChromeUtils.import("resource:///modules/
  * - let user verify and maybe edit the server names and ports
  * - If user clicks OK, create the account
  */
 
 // from http://xyfer.blogspot.com/2005/01/javascript-regexp-email-validator.html
 var emailRE = /^[-_a-z0-9\'+*$^&%=~!?{}]+(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*@(?:[-a-z0-9.]+\.[a-z]{2,20}|\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$/i;
 
 if (typeof gEmailWizardLogger == "undefined") {
-  ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.setup");
   gEmailWizardLogger.level = Log4Moz.Level.Info;
   gEmailWizardLogger.addAppender(new Log4Moz.ConsoleAppender(new Log4Moz.BasicFormatter())); // browser console
 }
 
 var gStringsBundle;
 var gMessengerBundle;
 var gBrandShortName;
@@ -119,18 +135,17 @@ function removeChildNodes(el) {
   while (el.hasChildNodes()) {
     el.lastChild.remove();
   }
 }
 
 function EmailConfigWizard() {
   this._init();
 }
-EmailConfigWizard.prototype =
-{
+EmailConfigWizard.prototype = {
   _init() {
     gEmailWizardLogger.info("Initializing setup wizard");
     this._abortable = null;
   },
 
   onLoad() {
     /**
      * this._currentConfig is the config we got either from the XML file or
@@ -1807,18 +1822,17 @@ function getStandardPorts(protocolType) 
  *
  * This is effectively a separate dialog, but implemented as part of
  * this dialog. It works by hiding the main dialog part and unhiding
  * the this part, and vice versa, and resizing the dialog.
  */
 function SecurityWarningDialog() {
   this._acknowledged = [];
 }
-SecurityWarningDialog.prototype =
-{
+SecurityWarningDialog.prototype = {
   /**
    * {Array of {(incoming or outgoing) server part of {AccountConfig}}
    * A list of the servers for which we already showed this dialog and the
    * user approved the configs. For those, we won't show the warning again.
    * (Make sure to store a copy in case the underlying object is changed.)
    */
   _acknowledged: null,
 
--- a/mail/components/accountcreation/content/exchangeAutoDiscover.js
+++ b/mail/components/accountcreation/content/exchangeAutoDiscover.js
@@ -1,17 +1,18 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
+/* import-globals-from emailWizard.js */
+
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/JXON.js");
 ChromeUtils.defineModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
-/* eslint-disable complexity, no-lonely-if */
+var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 
 /**
  * Tries to get a configuration from an MS Exchange server
  * using Microsoft AutoDiscover protocol.
  *
  * Disclaimers:
  * - To support domain hosters, we cannot use SSL. That means we
  *   rely on insecure DNS and http, which means the results may be
@@ -145,16 +146,17 @@ function readAutoDiscoverResponse(autoDi
 
   if (config.isComplete()) {
     successCallback(config);
   } else {
     errorCallback(new Exception("No valid configs found in AutoDiscover XML"));
   }
 }
 
+/* eslint-disable complexity */
 /**
  * @param {JXON} xml - The Exchange server AutoDiscover response
  * @param {string} username - (Optional) The user's login name
  *     If null, email address placeholder will be used.
  * @returns {AccountConfig} - @see accountConfig.js
  *
  * @see <https://www.msxfaq.de/exchange/autodiscover/autodiscover_xml.htm>
  */
@@ -266,17 +268,17 @@ function readAutoDiscoverXML(autoDiscove
 
         if (type == "SMTP") {
           if (!config.outgoing.hostname) {
             config.outgoing = server;
           } else {
             config.outgoingAlternatives.push(server);
           }
         } else {
-          if (!config.incoming.hostname) {
+          if (!config.incoming.hostname) { // eslint-disable-line no-lonely-if
             config.incoming = server;
           } else {
             config.incomingAlternatives.push(server);
           }
         }
       }
 
       // else unknown or unsupported protocol
@@ -289,16 +291,17 @@ function readAutoDiscoverXML(autoDiscove
     config.oauthSettings = {
       issuer: config.incoming.hostname,
       scope: config.incoming.owaURL || config.incoming.ewsURL,
     };
   }
 
   return config;
 }
+/* eslint-enable complexity */
 
 /**
  * Ask server which addons can handle this config.
  * @param {AccountConfig} config
  * @param {Function(config {AccountConfig})} successCallback
  * @returns {Abortable}
  */
 function getAddonsList(config, successCallback, errorCallback) {
--- a/mail/components/accountcreation/content/fetchConfig.js
+++ b/mail/components/accountcreation/content/fetchConfig.js
@@ -1,13 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
+/* import-globals-from emailWizard.js */
+
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/JXON.js");
 
 /**
  * Tries to find a configuration for this ISP on the local harddisk, in the
  * application install directory's "isp" subdirectory.
  * Params @see fetchConfigFromISP()
--- a/mail/components/accountcreation/content/fetchhttp.js
+++ b/mail/components/accountcreation/content/fetchhttp.js
@@ -10,17 +10,20 @@
  *
  * It does not provide download progress, but assumes that the
  * fetched resource is so small (<1 10 KB) that the roundtrip and
  * response generation is far more significant than the
  * download time of the response. In other words, it's fine for RPC,
  * but not for bigger file downloads.
  */
 
+/* import-globals-from emailWizard.js */
+
 ChromeUtils.import("resource:///modules/JXON.js");
+var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 
 /**
  * Set up a fetch.
  *
  * @param {string} url - URL of the server function.
  *    ATTENTION: The caller needs to make sure that the URL is secure to call.
  * @param {Object} args - Additional parameters as properties, see below
  *
@@ -99,18 +102,17 @@ function FetchHTTP(url, args, successCal
   this._args.allowCache = "allowCache" in args ? sanitize.boolean(args.allowCache) : true; // default true
   this._args.allowAuthPrompt = sanitize.boolean(args.allowAuthPrompt || false); // default false
   this._args.requireSecureAuth = sanitize.boolean(args.requireSecureAuth || false); // default false
   this._successCallback = successCallback;
   this._errorCallback = errorCallback;
   this._logger = Log4Moz.getConfiguredLogger("mail.setup");
   this._logger.info("Requesting <" + url + ">");
 }
-FetchHTTP.prototype =
-{
+FetchHTTP.prototype = {
   __proto__: Abortable.prototype,
   _url: null, // URL as passed to ctor, without arguments
   _args: null,
   _successCallback: null,
   _errorCallback: null,
   _request: null, // the XMLHttpRequest object
   result: null,
 
--- a/mail/components/accountcreation/content/guessConfig.js
+++ b/mail/components/accountcreation/content/guessConfig.js
@@ -1,14 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+/* import-globals-from emailWizard.js */
+
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var TIMEOUT = 10; // in seconds
 
 // This is a bit ugly - we set outgoingDone to false
 // when emailWizard.js cancels the outgoing probe because the user picked
 // an outoing server. It does this by poking the probeAbortable object,
 // so we need outgoingDone to have global scope.
@@ -279,18 +281,17 @@ var kSuccess = 3;
  * Used as |thisTry|.
  *
  * Note: The consts it uses for protocol and ssl are defined towards the end
  * of this file and not the same as those used in AccountConfig (type,
  * socketType). (fix this)
  */
 function HostTry() {
 }
-HostTry.prototype =
-{
+HostTry.prototype = {
   // IMAP, POP or SMTP
   protocol: UNKNOWN,
   // {String}
   hostname: undefined,
   // {Integer}
   port: undefined,
   // NONE, SSL or TLS
   ssl: UNKNOWN,
@@ -340,18 +341,17 @@ function HostDetector(progressCallback, 
   // {Array of {HostTry}}, ordered by decreasing preference
   this._hostsToTry = [];
 
   // init logging
   this._log = Log4Moz.getConfiguredLogger("mail.wizard");
   this._log.info("created host detector");
 }
 
-HostDetector.prototype =
-{
+HostDetector.prototype = {
   cancel(ex) {
     this._cancel = true;
     // We have to actively stop the network calls, as they may result in
     // callbacks e.g. to the cert handler. If the dialog is gone by the time
     // this happens, the javascript stack is horked.
     for (let i = 0; i < this._hostsToTry.length; i++) {
       let thisTry = this._hostsToTry[i]; // {HostTry}
       if (thisTry.abortable)
@@ -611,18 +611,17 @@ function chooseBestAuthMethod(authMethod
     return Ci.nsMsgAuthMethod.passwordCleartext;
   return authMethods.shift(); // take first (= most preferred)
 }
 
 function IncomingHostDetector(
   progressCallback, successCallback, errorCallback) {
   HostDetector.call(this, progressCallback, successCallback, errorCallback);
 }
-IncomingHostDetector.prototype =
-{
+IncomingHostDetector.prototype = {
   __proto__: HostDetector.prototype,
   _hostnamesToTry(protocol, domain) {
     var hostnamesToTry = [];
     if (protocol != POP)
       hostnamesToTry.push("imap." + domain);
     if (protocol != IMAP) {
       hostnamesToTry.push("pop3." + domain);
       hostnamesToTry.push("pop." + domain);
@@ -633,18 +632,17 @@ IncomingHostDetector.prototype =
   },
   _portsToTry: getIncomingTryOrder,
 };
 
 function OutgoingHostDetector(
   progressCallback, successCallback, errorCallback) {
   HostDetector.call(this, progressCallback, successCallback, errorCallback);
 }
-OutgoingHostDetector.prototype =
-{
+OutgoingHostDetector.prototype = {
   __proto__: HostDetector.prototype,
   _hostnamesToTry(protocol, domain) {
     var hostnamesToTry = [];
     hostnamesToTry.push("smtp." + domain);
     hostnamesToTry.push("mail." + domain);
     hostnamesToTry.push(domain);
     return hostnamesToTry;
   },
@@ -848,18 +846,17 @@ function protocolToString(type) {
  */
 function SSLErrorHandler(thisTry, logger) {
   this._try = thisTry;
   this._log = logger;
   // _ gotCertError will be set to an error code (one of those defined in
   // nsICertOverrideService)
   this._gotCertError = 0;
 }
-SSLErrorHandler.prototype =
-{
+SSLErrorHandler.prototype = {
   processCertError(socketInfo, secInfo, targetSite) {
     this._log.error("Got Cert error for " + targetSite);
 
     if (!status)
       return true;
 
     let cert = secInfo.serverCert;
     let flags = 0;
@@ -997,18 +994,17 @@ function SocketUtil(hostname, port, ssl,
     _error(e);
   }
   var outstream = transport.openOutputStream(0, 0, 0);
   var stream = transport.openInputStream(0, 0, 0);
   var instream = Cc["@mozilla.org/scriptableinputstream;1"]
       .createInstance(Ci.nsIScriptableInputStream);
   instream.init(stream);
 
-  var dataListener =
-  {
+  var dataListener = {
     data: [],
     onStartRequest(request, context) {
       try {
         initialized = true;
         if (!aborted) {
           // Send the first request
           let outputData = commands[index++];
           outstream.write(outputData, outputData.length);
--- a/mail/components/accountcreation/content/readFromXML.js
+++ b/mail/components/accountcreation/content/readFromXML.js
@@ -1,16 +1,18 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
+/* import-globals-from emailWizard.js */
+
+var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
+
 /* eslint-disable complexity */
-
 /**
  * Takes an XML snipplet (as JXON) and reads the values into
  * a new AccountConfig object.
  * It does so securely (or tries to), by trying to avoid remote execution
  * and similar holes which can appear when reading too naively.
  * Of course it cannot tell whether the actual values are correct,
  * e.g. it can't tell whether the host name is a good server.
  *
@@ -207,18 +209,17 @@ function readFromXML(clientConfigXML) {
   if (!d.outgoing.hostname)
     // throw exception for last server
     throw exception ? exception : "Need proper <outgoingServer> in XML file";
   exception = null;
 
   d.inputFields = [];
   for (let inputField of array_or_undef(xml.$inputField)) {
     try {
-      var fieldset =
-      {
+      let fieldset = {
         varname: sanitize.alphanumdash(inputField["@key"]).toUpperCase(),
         displayName: sanitize.label(inputField["@label"]),
         exampleValue: sanitize.label(inputField.value),
       };
       d.inputFields.push(fieldset);
     } catch (e) { logException(e); } // for now, don't throw,
         // because we don't support custom fields yet anyways.
   }
--- a/mail/components/accountcreation/content/sanitizeDatatypes.js
+++ b/mail/components/accountcreation/content/sanitizeDatatypes.js
@@ -1,30 +1,31 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
+/* import-globals-from emailWizard.js */
+/* globals cleanUpHostName, isLegalHostNameOrIP */
+ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
+
 /**
  * This is a generic input validation lib. Use it when you process
  * data from the network.
  *
  * Just a few functions which verify, for security purposes, that the
  * input variables (strings, if nothing else is noted) are of the expected
  * type and syntax.
  *
  * The functions take a string (unless noted otherwise) and return
  * the expected datatype in JS types. If the value is not as expected,
  * they throw exceptions.
  */
 
-ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
-
-var sanitize =
-{
+var sanitize = {
   integer(unchecked) {
     if (typeof(unchecked) == "number" && !isNaN(unchecked))
       return unchecked;
 
     var r = parseInt(unchecked);
     if (isNaN(r))
       throw new MalformedException("no_number.error", unchecked);
 
--- a/mail/components/accountcreation/content/util.js
+++ b/mail/components/accountcreation/content/util.js
@@ -1,22 +1,22 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 /**
  * Some common, generic functions
  */
 
-ChromeUtils.import("resource:///modules/errUtils.js");
+/* import-globals-from emailWizard.js */
+
+var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-/* eslint-disable spaced-comment */
 
-
-/////////////////////////////////////////
+// --------------------------
 // Low level, basic functions
 
 function assert(test, errorMsg) {
   if (!test)
     throw new NotReached(errorMsg ? errorMsg :
           "Programming bug. Assertion failed, see log.");
 }
 
@@ -108,55 +108,51 @@ function getStringBundle(bundleURI) {
   try {
     return Services.strings.createBundle(bundleURI);
   } catch (e) {
     throw new Exception("Failed to get stringbundle URI <" + bundleURI +
                         ">. Error: " + e);
   }
 }
 
-
-/////////////////////////////////////////
+// ---------
 // Exception
 
 function Exception(msg) {
   this._message = msg;
   this.stack = Components.stack.formattedStack;
 }
-Exception.prototype =
-{
+Exception.prototype = {
   get message() {
     return this._message;
   },
   toString() {
     return this._message;
   },
 };
 
 function NotReached(msg) {
   Exception.call(this, msg); // call super constructor
   logException(this);
 }
 // Make NotReached extend Exception.
 NotReached.prototype = Object.create(Exception.prototype);
 NotReached.prototype.constructor = NotReached;
 
-
-/////////////////////////////////////////
+// ---------
 // Abortable
 
 /**
  * A handle for an async function which you can cancel.
  * The async function will return an object of this type (a subtype)
  * and you can call cancel() when you feel like killing the function.
  */
 function Abortable() {
 }
-Abortable.prototype =
-{
+Abortable.prototype = {
   cancel(e) {
   },
 };
 
 function CancelledException(msg) {
   Exception.call(this, msg);
 }
 CancelledException.prototype = Object.create(Exception.prototype);
@@ -429,18 +425,17 @@ PriorityOrderAbortable.prototype = Objec
 PriorityOrderAbortable.prototype.constructor = PriorityOrderAbortable;
 
 function NoLongerNeededException(msg) {
   CancelledException.call(this, msg);
 }
 NoLongerNeededException.prototype = Object.create(CancelledException.prototype);
 NoLongerNeededException.prototype.constructor = NoLongerNeededException;
 
-
-/////////////////////////////////////////
+// -------------------
 // High level features
 
 /**
  * Allows you to install an addon.
  *
  * Example:
  * var installer = new AddonInstaller({ xpiURL : "https://...xpi", id: "...", ...});
  * installer.install();
@@ -546,17 +541,17 @@ AddonInstaller.prototype.cancel = functi
     try {
       this._installer.cancel();
     } catch (e) { // if install failed
       ddump(e);
     }
   }
 };
 
-/////////////////////////////////////////
+// ------------
 // Debug output
 
 function deepCopy(org) {
   if (typeof(org) == "undefined")
     return undefined;
   if (org == null)
     return null;
   if (typeof(org) == "string")
@@ -580,17 +575,16 @@ function deepCopy(org) {
   return result;
 }
 
 if (typeof gEmailWizardLogger == "undefined") {
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.setup");
   gEmailWizardLogger.level = Log4Moz.Level.Info;
   gEmailWizardLogger.addAppender(new Log4Moz.ConsoleAppender(new Log4Moz.BasicFormatter())); // browser console
-  //gEmailWizardLogger.addAppender(new Log4Moz.DumpAppender(new Log4Moz.BasicFormatter())); // stdout
 }
 
 function ddump(text) {
   gEmailWizardLogger.info(text);
 }
 
 function debugObject(obj, name, maxDepth, curDepth) {
   if (curDepth == undefined)
--- a/mail/components/accountcreation/content/verifyConfig.js
+++ b/mail/components/accountcreation/content/verifyConfig.js
@@ -1,15 +1,18 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 /* 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/. */
 
+/* import-globals-from emailWizard.js */
+
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/OAuth2Providers.jsm");
+var { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 
 if (typeof gEmailWizardLogger == "undefined") {
   ChromeUtils.import("resource:///modules/gloda/log4moz.js");
   var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
 }
 
 /**
  * This checks a given config, by trying a real connection and login,
@@ -154,18 +157,17 @@ function urlListener(config, server, alt
   this.mServer = server;
   this.mAlter = alter;
   this.mSuccessCallback = successCallback;
   this.mErrorCallback = errorCallback;
   this.mMsgWindow = msgWindow;
   this.mCertError = false;
   this._log = Log4Moz.getConfiguredLogger("mail.wizard");
 }
-urlListener.prototype =
-{
+urlListener.prototype = {
   OnStartRunningUrl(aUrl) {
     this._log.info("Starting to test username");
     this._log.info("  username=" + (this.mConfig.incoming.username !=
                           this.mConfig.identity.emailAddress) +
                           ", have savedUsername=" +
                           (this.mConfig.usernameSaved ? "true" : "false"));
     this._log.info("  authMethod=" + this.mServer.authMethod);
   },
--- a/mail/components/activity/modules/autosync.jsm
+++ b/mail/components/activity/modules/autosync.jsm
@@ -19,19 +19,17 @@ var nsIAutoSyncMgrListener = Ci.nsIAutoS
  * This code aims to mediate between the auto-sync code and the activity mgr.
  *
  * Not every auto-sync activity is directly  mapped to a process or event.
  * To prevent a possible event overflow, Auto-Sync monitor generates one
  * sync'd event per account when after all its _pending_ folders are sync'd,
  * rather than generating one event per folder sync.
  */
 
-var autosyncModule =
-{
-
+var autosyncModule = {
   _inQFolderList: [],
   _running: false,
   _syncInfoPerFolder: new Map(),
   _syncInfoPerServer: new Map(),
   _lastMessage: new Map(),
 
   get log() {
     delete this.log;
--- a/mail/components/activity/modules/glodaIndexer.jsm
+++ b/mail/components/activity/modules/glodaIndexer.jsm
@@ -14,18 +14,17 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js", null);
 const { GlodaIndexer } = ChromeUtils.import("resource:///modules/gloda/indexer.js", null);
 
 /**
  * Gloda message indexer feedback.
  */
-var glodaIndexerActivity =
-{
+var glodaIndexerActivity = {
   get log() {
     delete this.log;
     return this.log = Log4Moz.getConfiguredLogger("glodaIndexerActivity");
   },
 
   get activityMgr() {
     delete this.activityMgr;
     return this.activityMgr = Cc["@mozilla.org/activity-manager;1"]
--- a/mail/components/activity/modules/moveCopy.jsm
+++ b/mail/components/activity/modules/moveCopy.jsm
@@ -10,18 +10,17 @@ var nsActEvent = Components.Constructor(
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 
 // This module provides a link between the move/copy code and the activity
 // manager.
-var moveCopyModule =
-{
+var moveCopyModule = {
   lastMessage: {},
   lastFolder: {},
 
   get log() {
     delete this.log;
     return this.log = Log4Moz.getConfiguredLogger("moveCopyModule");
   },
 
--- a/mail/components/activity/modules/pop3Download.jsm
+++ b/mail/components/activity/modules/pop3Download.jsm
@@ -10,18 +10,17 @@ var nsActEvent = Components.Constructor(
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 
 // This module provides a link between the pop3 service code and the activity
 // manager.
-var pop3DownloadModule =
-{
+var pop3DownloadModule = {
   // hash table of most recent download items per folder
   _mostRecentActivityForFolder: new Map(),
   // hash table of prev download items per folder, so we can
   // coalesce consecutive no new message events.
   _prevActivityForFolder: new Map(),
 
   get log() {
     delete this.log;
--- a/mail/components/activity/modules/sendLater.jsm
+++ b/mail/components/activity/modules/sendLater.jsm
@@ -38,18 +38,17 @@ var sendMsgProgressListener = {
 
   showProgress(aPercentage) {
     sendLaterModule.onMessageSendProgress(0, 0, aPercentage, 0);
   },
 };
 
 // This module provides a link between the send later service and the activity
 // manager.
-var sendLaterModule =
-{
+var sendLaterModule = {
   _sendProcess: null,
   _copyProcess: null,
   _identity: null,
   _subject: null,
 
   get log() {
     delete this.log;
     return this.log = Log4Moz.getConfiguredLogger("sendLaterModule");
deleted file mode 100644
--- a/mail/components/addrbook/content/.eslintrc.js
+++ /dev/null
@@ -1,54 +0,0 @@
-"use strict";
-
-module.exports = {
-  "globals": {
-    // abCommon.js
-    "AbEditCard": true,
-    "AbNewMessage": true,
-    "ChangeDirectoryByURI": true,
-    "DirPaneController": true,
-    "GenerateAddressFromCard": true,
-    "GetDirectoryFromURI": true,
-    "GetParentDirectoryFromMailingListURI": true,
-    "InitCommonJS": true,
-    "SelectFirstAddressBook": true,
-    "abList": true,
-    "defaultPhotoURI": true,
-    "gAbResultsTree": true,
-    "gAbView": true,
-    "gAddressBookBundle": true,
-    "gDirTree": true,
-    "gImageDownloader": true,
-    "gShowAbColumnInComposeSidebar": true,
-    "getPhotoURI": true,
-    "getPhotosDir": true,
-    "getSelectedDirectory": true,
-    "getSelectedDirectoryURI": true,
-    "goNewCardDialog": true,
-    "goNewListDialog": true,
-    "kAllDirectoryRoot": true,
-    "kCollectedAddressbookURI": true,
-    "kDefaultAscending": true,
-    "kDefaultDescending": true,
-    "kDefaultSortColumn": true,
-    "kDefaultYear": true,
-    "kLdapUrlPrefix": true,
-    "kMaxYear": true,
-    "kMinYear": true,
-    "kPersonalAddressbookURI": true,
-    "saneBirthYear": true,
-    "selectStartupViewDirectory": true,
-
-    // mailnews/addrbook/content/abResultsPane.js
-    "AbEditSelectedCard": true,
-    "CloseAbView": true,
-    "GetSelectedAbCards": true,
-    "GetSelectedAddresses": true,
-    "GetSelectedCardIndex": true,
-    "GetSelectedCardTypes": true,
-    "ResultsPaneController": true,
-    "SelectFirstCard": true,
-    "SetAbView": true,
-    "SortAndUpdateIndicators": true,
-  },
-};
--- a/mail/components/addrbook/content/abCard.js
+++ b/mail/components/addrbook/content/abCard.js
@@ -1,13 +1,15 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from abCommon.js */
+
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kNonVcardFields =
         ["NickNameContainer", "SecondaryEmailContainer", "ScreenNameContainer",
          "customFields", "preferDisplayName"];
 
 var kPhoneticFields =
--- a/mail/components/addrbook/content/abCardView.js
+++ b/mail/components/addrbook/content/abCardView.js
@@ -1,13 +1,15 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from abCommon.js */
+
 // NOTE: gAddressBookBundle must be defined and set or this Overlay won't work
 
 ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gProfileDirURL;
 var gFileHandler = Services.io.getProtocolHandler("file")
   .QueryInterface(Ci.nsIFileProtocolHandler);
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -1,27 +1,19 @@
 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
-// addressbook.js
-/* globals PluralForm, ResultsPaneSelectionChanged, gPreviousDirTreeIndex, onEnterInSearchBar */
-// abTrees.js
-/* globals gDirectoryTreeView */
-
-// mail/base/content/utilityOverlay.js
-/* globals goSetMenuValue */
-
-// mailnews/addrbook/content/abResultsPane.js
-/* globals kCardsOnly, kListsAndCards, kMultipleListsOnly, kNothingSelected, kSingleListOnly */
-
-// toolkit/content/globalOverlay.js
-/* globals goUpdateCommand */
+/* import-globals-from ../../../../../toolkit/content/globalOverlay.js */
+/* import-globals-from ../../../../mailnews/addrbook/content/abResultsPane.js */
+/* import-globals-from ../../../base/content/utilityOverlay.js */
+/* import-globals-from abTrees.js */
+/* import-globals-from addressbook.js */
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 var gDirTree;
@@ -47,18 +39,17 @@ var kPersonalAddressbookURI = "moz-abmdb
 var kCollectedAddressbookURI = "moz-abmdbdirectory://history.mab";
 // The default, generic contact image is displayed via CSS when the photoURI is
 // blank.
 var defaultPhotoURI = "";
 
 var PERMS_DIRECTORY = parseInt("0755", 8);
 
 // Controller object for Dir Pane
-var DirPaneController =
-{
+var DirPaneController = {
   supportsCommand(command) {
     switch (command) {
       case "cmd_selectAll":
       case "cmd_delete":
       case "button_delete":
       case "cmd_properties":
       case "cmd_abToggleStartupDir":
       case "cmd_printcard":
--- a/mail/components/addrbook/content/abContactsPanel.js
+++ b/mail/components/addrbook/content/abContactsPanel.js
@@ -1,26 +1,22 @@
 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
-// addressbook.js
-/* globals gQueryURIFormat */
+/* import-globals-from ../../../../mailnews/addrbook/content/abResultsPane.js */
+/* import-globals-from abCommon.js */
 
-// mailnews/addrbook/content/abResultsPane.js
-/* globals GetNumSelectedCards */
-// mailnews/base/util/ABQueryUtils.jsm
-/* globals getModelQuery, getSearchTokens, generateQueryURI */
-
-// toolkit/content/globalOverlay.js
-/* globals goUpdateCommand */
-
-ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
+var {
+  getSearchTokens,
+  getModelQuery,
+  generateQueryURI,
+} = ChromeUtils.import("resource:///modules/ABQueryUtils.jsm", null);
 
 function GetAbViewListener() {
   // the ab panel doesn't care if the total changes, or if the selection changes
   return null;
 }
 
 /**
  * Handle the context menu event of results tree (right-click, context menu key
--- a/mail/components/addrbook/content/abTrees.js
+++ b/mail/components/addrbook/content/abTrees.js
@@ -1,16 +1,14 @@
 /* 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/. */
 
-// mailnews/addrbook/content/abDragDrop.js
-/* globals abDirTreeObserver */
-// mailnews/base/content/jsTreeView.js
-/* globals PROTO_TREE_VIEW */
+/* import-globals-from ../../../../mailnews/addrbook/content/abDragDrop.js */
+/* import-globals-from abCommon.js */
 
 /**
  * This file contains our implementation for various addressbook trees.  It
  * depends on jsTreeView.js being loaded before this script is loaded.
  */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
--- a/mail/components/addrbook/content/addressbook.js
+++ b/mail/components/addrbook/content/addressbook.js
@@ -1,37 +1,27 @@
 /* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /*
  * 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/. */
 
-// abCardView.js
-/* globals ClearCardViewPane, DisplayCardViewPane, OnLoadCardView */
-// abTrees.js
-/* globals gDirectoryTreeView */
-
-// mail/base/content/mail-compacttheme.js
-/* globals CompactTheme */
-// mail/base/content/mailCore.js
-/* globals MailToolboxCustomizeDone */
-// mail/base/content/toolbarIconColor.js
-/* globals ToolbarIconColor */
-// mailnews/base/content/msgPrintEngine.js
-/* globals printEngineWindow */
-// mailnews/base/util/ABQueryUtils.jsm
-/* globals getModelQuery, getSearchTokens, generateQueryURI */
-
-// toolkit/content/globalOverlay.js
-/* globals goUpdateCommand */
+/* import-globals-from ../../../../mailnews/addrbook/content/abResultsPane.js */
+/* import-globals-from ../../../../mailnews/base/content/msgPrintEngine.js */
+/* import-globals-from abCardView.js */
+/* import-globals-from abCommon.js */
 
 // Ensure the activity modules are loaded for this window.
 ChromeUtils.import("resource:///modules/activity/activityModules.jsm");
-ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
+var {
+  getSearchTokens,
+  getModelQuery,
+  generateQueryURI,
+} = ChromeUtils.import("resource:///modules/ABQueryUtils.jsm", null);
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
@@ -359,23 +349,21 @@ function AbPrintCardInternal(doPrintPrev
   for (let i = 0; i < numSelected; i++) {
     let card = selectedItems[i];
     let printCardUrl = CreatePrintCardUrl(card);
     if (printCardUrl) {
       selectionArray.push(printCardUrl);
     }
   }
 
-  /* eslint-disable no-global-assign */
-  printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
-                                         "",
-                                         "chrome,dialog=no,all",
-                                         selectionArray.length, selectionArray,
-                                         statusFeedback, doPrintPreview, msgType);
-  /* eslint-enable no-global-assign */
+  window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
+                    "",
+                    "chrome,dialog=no,all",
+                    selectionArray.length, selectionArray,
+                    statusFeedback, doPrintPreview, msgType);
 }
 
 function AbPrintCard() {
   AbPrintCardInternal(false, Ci.nsIMsgPrintEngine.MNAB_PRINT_AB_CARD);
 }
 
 function AbPrintPreviewCard() {
   AbPrintCardInternal(true, Ci.nsIMsgPrintEngine.MNAB_PRINTPREVIEW_AB_CARD);
@@ -397,22 +385,20 @@ function AbPrintAddressBookInternal(doPr
   /*
     turn "moz-abmdbdirectory://abook.mab" into
     "addbook://moz-abmdbdirectory/abook.mab?action=print"
    */
 
   var abURIArr = uri.split("://");
   var printUrl = "addbook://" + abURIArr[0] + "/" + abURIArr[1] + "?action=print";
 
-  /* eslint-disable no-global-assign */
-  printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
+  window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
                     "",
                     "chrome,dialog=no,all",
                     1, [printUrl], statusFeedback, doPrintPreview, msgType);
-  /* eslint-enable no-global-assign */
 }
 
 function AbPrintAddressBook() {
   AbPrintAddressBookInternal(false, Ci.nsIMsgPrintEngine.MNAB_PRINT_ADDRBOOK);
 }
 
 function AbPrintPreviewAddressBook() {
   AbPrintAddressBookInternal(true, Ci.nsIMsgPrintEngine.MNAB_PRINTPREVIEW_ADDRBOOK);
--- a/mail/components/appIdleManager.js
+++ b/mail/components/appIdleManager.js
@@ -10,18 +10,17 @@ ChromeUtils.import("resource://gre/modul
 // This module provides a mechanism to turn window focus and blur events
 // into app idle notifications. If we get a blur notification that is not
 // followed by a focus notification in less than some small number of seconds,
 // then we send a begin app idle notification.
 // If we get a focus event, and we're app idle, then we send an end app idle
 // notification.
 // The notification topic is "mail:appIdle", the values are "idle", and "back"
 
-var appIdleManager =
-{
+var appIdleManager = {
   _appIdle: false,
   _timerInterval: 5000, // 5 seconds ought to be plenty
   get _timer() {
     delete this._timer;
     return this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   },
 
   _timerCallback() {
deleted file mode 100644
--- a/mail/components/compose/content/.eslintrc.js
+++ /dev/null
@@ -1,56 +0,0 @@
-"use strict";
-
-module.exports = {
-  globals: {
-    // editor/ui/composer/content/ComposerCommands.js
-    doStatefulCommand: true,
-    SaveDocument: true,
-    // editor/ui/composer/content/editor.js
-    EditorCleanup: true,
-    EditorSetFontSize: true,
-    EditorSharedStartup: true,
-    gChromeState: true,
-    gDefaultBackgroundColor: true,
-    gDefaultTextColor: true,
-    GetBodyElement: true,
-    initLocalFontFaceMenu: true,
-    onBackgroundColorChange: true,
-    onFontColorChange: true,
-    // editor/ui/composer/content/editorUtilities.js:
-    GetCurrentCommandManager: true,
-    GetCurrentEditor: true,
-    GetCurrentEditorElement: true,
-
-    // mail/base/content/contentAreaClick.js
-    openLinkExternally: true,
-    // mail/base/content/mailCore.js
-    CreateAttachmentTransferData: true,
-    MailToolboxCustomizeDone: true,
-    openOptionsDialog: true,
-    // mail/base/content/mail-compacttheme.js
-    CompactTheme: true,
-    // mail/base/content/nsDragAndDrop.js
-    FlavourSet: true,
-    nsDragAndDrop: true,
-    // mail/base/content/toolbarIconColor.js
-    ToolbarIconColor: true,
-    // mail/base/content/utilityOverlay.js
-    goToggleToolbar: true,
-    openContentTab: true,
-
-    // mailnews/addrbook/content/abDragDrop.js
-    DragAddressOverTargetControl: true,
-    // mailnews/base/prefs/content/accountUtils.js
-    MsgAccountManager: true,
-    verifyAccounts: true,
-
-    // toolkit/components/printing/content/printUtils.js
-    PrintUtils: true,
-    // toolkit/content/globalOverlay.js
-    goDoCommand: true,
-    goSetCommandEnabled: true,
-    goUpdateCommand: true,
-    // toolkit/content/viewZoomOverlay.js
-    ZoomManager: true,
-  },
-};
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1,12 +1,18 @@
 /* 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/. */
 
+/* import-globals-from ../../../../editor/ui/composer/content/ComposerCommands.js */
+/* import-globals-from ../../../../editor/ui/composer/content/editor.js */
+/* import-globals-from ../../../../editor/ui/composer/content/editorUtilities.js */
+/* import-globals-from ../../../../mailnews/addrbook/content/abDragDrop.js */
+/* import-globals-from ../../../base/content/mailCore.js */
+/* import-globals-from ../../../base/content/utilityOverlay.js */
 /* import-globals-from addressingWidgetOverlay.js */
 
 /**
  * Commands for the message composition window.
  */
 
 // Ensure the activity modules are loaded for this window.
 ChromeUtils.import("resource:///modules/activity/activityModules.jsm");
@@ -3072,21 +3078,21 @@ function GetCharsetUIString() {
   return "";
 }
 
 // Add-ons can override this to customize the behavior.
 function DoSpellCheckBeforeSend() {
   return Services.prefs.getBoolPref("mail.SpellCheckBeforeSend");
 }
 
+/* eslint-disable complexity */
 /**
  * Handles message sending operations.
  * @param msgType nsIMsgCompDeliverMode of the operation.
  */
-/* eslint-disable complexity */
 function GenericSendMessage(msgType) {
   var msgCompFields = gMsgCompose.compFields;
 
   Recipients2CompFields(msgCompFields);
   let addresses = MailServices.headerParser
                               .makeFromDisplayAddress(GetMsgIdentityElement().value);
   msgCompFields.from = MailServices.headerParser.makeMimeHeader(addresses, addresses.length);
   var subject = GetMsgSubjectElement().value;
@@ -4739,28 +4745,28 @@ function RenameSelectedAttachment() {
     // Hack to ensure that reorderAttachmentsPanel does not get closed as we exit.
     bucket.setAttribute("data-ignorenextblur", "true");
   }
   // Update cmd_sortAttachmentsToggle because renaming may change the current
   // sort order.
   goUpdateCommand("cmd_sortAttachmentsToggle");
 }
 
+/* eslint-disable complexity */
 /**
  * Move selected attachment(s) within the attachment list.
  *
  * @param aDirection  "up"        : Move attachments up in the list.
  *                    "down"      : Move attachments down in the list.
  *                    "top"       : Move attachments to the top of the list.
  *                    "bottom"    : Move attachments to the bottom of the list.
  *                    "bundleUp"  : Move attachments together (upwards).
  *                    "bundleDown": Move attachments together (downwards).
  *                    "toggleSort": Sort attachments alphabetically (toggle).
  */
-/* eslint-disable complexity */
 function moveSelectedAttachments(aDirection) {
   // Command controllers will bail out if no or all attachments are selected,
   // or if block selections can't be moved, or if other direction-specific
   // adverse circumstances prevent the intended movement.
 
   if (!aDirection)
     return;
 
--- a/mail/components/compose/content/addressingWidgetOverlay.js
+++ b/mail/components/compose/content/addressingWidgetOverlay.js
@@ -960,18 +960,17 @@ function parseAndAddAddresses(addressTex
 
 function AutomatedAutoCompleteHandler() {
 }
 
 // state driven self contained object which will autocomplete a block of addresses without any UI.
 // force picks the first match and adds it to the addressing widget, then goes on to the next
 // name to complete.
 
-AutomatedAutoCompleteHandler.prototype =
-{
+AutomatedAutoCompleteHandler.prototype = {
   param: this,
   sessionName: null,
   namesToComplete: null,
   numNamesToComplete: 0,
   indexIntoNames: 0,
   finalAddresses: null,
 
   numSessionsToSearch: 0,
deleted file mode 100644
--- a/mail/components/preferences/.eslintrc.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-module.exports = {
-  "globals": {
-    // preferences.js
-    "AppConstants": true,
-    "MailServices": true,
-    "Services": true,
-    "ExtensionSupport": true,
-
-    // subdialogs.js
-    "gSubDialog": true,
-  },
-};
--- a/mail/components/preferences/advanced.js
+++ b/mail/components/preferences/advanced.js
@@ -1,15 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * 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/. */
 
-// mail/base/content/aboutDialog-appUpdater.js
-/* globals appUpdater, gAppUpdater */
+/* import-globals-from ../../base/content/aboutDialog-appUpdater.js */
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
 
 // Load DownloadUtils module for convertByteUnits
 ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/L10nRegistry.jsm");
 ChromeUtils.import("resource://gre/modules/Localization.jsm");
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -1,18 +1,18 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 /* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
+
 // applications.inc.xul
 /* globals ICON_URL_APP */
-// mail/base/content/contentAreaClick.js
-/* globals openLinkExternally */
 
 // ------------------------------
 // Constants & Enumeration Values
 
 // For CSS. Can be one of "ask", "save", or "feed". If absent, the icon URL
 // was set by us to a custom handler icon and CSS should not try to override it.
 var APP_ICON_ATTR_NAME = "appHandlerIcon";
 
--- a/mail/components/preferences/compose.js
+++ b/mail/components/preferences/compose.js
@@ -1,13 +1,16 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
+
 ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
 
 var gComposePane = {
   mInitialized: false,
   mSpellChecker: null,
   mDictCount: 0,
 
   init() {
--- a/mail/components/preferences/display.js
+++ b/mail/components/preferences/display.js
@@ -1,15 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-// toolkit/mozapps/preferences/fontbuilder.js
-/* globals FontBuilder */
+/* import-globals-from ../../../../toolkit/mozapps/preferences/fontbuilder.js */
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
 
 var gDisplayPane = {
   mInitialized: false,
   mTagListBox:  null,
 
   init() {
     if (!(("arguments" in window) && window.arguments[1])) {
       // If no tab was specified, select the last used tab.
--- a/mail/components/preferences/downloads.js
+++ b/mail/components/preferences/downloads.js
@@ -1,13 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from preferences.js */
+
 ChromeUtils.import("resource://gre/modules/Downloads.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 
 var gDownloadDirSection = {
   async chooseFolder() {
     var fp = Cc["@mozilla.org/filepicker;1"]
                .createInstance(Ci.nsIFilePicker);
     var bundlePreferences = document.getElementById("bundlePreferences");
--- a/mail/components/preferences/general.js
+++ b/mail/components/preferences/general.js
@@ -1,13 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
+
 var gGeneralPane = {
   mPane: null,
   mStartPageUrl: "",
 
   init() {
     this.mPane = document.getElementById("paneGeneral");
 
     this.updateStartPage();
--- a/mail/components/preferences/messagestyle.js
+++ b/mail/components/preferences/messagestyle.js
@@ -1,15 +1,20 @@
 /* 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/. */
 
+/* import-globals-from preferences.js */
+
 var jsProtoHelper = {};
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm", jsProtoHelper);
-const { getThemeByName, getThemeVariants } = ChromeUtils.import("resource:///modules/imThemes.jsm", null);
+const {
+  getThemeByName,
+  getThemeVariants,
+} = ChromeUtils.import("resource:///modules/imThemes.jsm", null);
 
 function Conversation(aName) {
   this._name = aName;
   this._observers = [];
   let now = new Date();
   this._date = new Date(now.getFullYear(), now.getMonth(), now.getDate(),
                         10, 42, 22) * 1000;
 }
--- a/mail/components/preferences/privacy.js
+++ b/mail/components/preferences/privacy.js
@@ -1,13 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
+
 var gPrivacyPane = {
 
   init() {
   },
 
   /**
    * Reload the current message after a preference affecting the view
    * has been changed and we are in instantApply mode.
--- a/mail/components/preferences/security.js
+++ b/mail/components/preferences/security.js
@@ -1,13 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
+/* import-globals-from preferences.js */
+/* import-globals-from subdialogs.js */
+
 ChromeUtils.defineModuleGetter(this, "LoginHelper", "resource://gre/modules/LoginHelper.jsm");
 
 var gSecurityPane = {
   mPane: null,
   mInitialized: false,
 
   init() {
     this.mPane = document.getElementById("paneSecurity");
--- a/mail/components/preferences/subdialogs.js
+++ b/mail/components/preferences/subdialogs.js
@@ -1,14 +1,16 @@
 /* - 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/. */
 
 "use strict";
 
+/* import-globals-from preferences.js */
+
 /**
  * SubDialog constructor creates a new subdialog from a template and appends
  * it to the parentElement.
  * @param {DOMNode} template: The template is copied to create a new dialog.
  * @param {DOMNode} parentElement: New dialog is appended onto parentElement.
  * @param {String}  id: A unique identifier for the dialog.
  */
 function SubDialog({template, parentElement, id}) {
--- a/mail/extensions/smime/content/msgCompSMIMEOverlay.js
+++ b/mail/extensions/smime/content/msgCompSMIMEOverlay.js
@@ -1,15 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 /* import-globals-from ../../../../mailnews/base/prefs/content/accountUtils.js */
 /* import-globals-from ../../../components/compose/content/MsgComposeCommands.js */
+/* import-globals-from ../../../components/compose/content/addressingWidgetOverlay.js */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 // Account encryption policy values:
 // const kEncryptionPolicy_Never = 0;
 // 'IfPossible' was used by ns4.
 // const kEncryptionPolicy_IfPossible = 1;
--- a/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
+++ b/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
@@ -1,15 +1,16 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 /* import-globals-from ../../../../mailnews/extensions/smime/content/msgReadSMIMEOverlay.js */
 /* import-globals-from ../../../base/content/folderDisplay.js */
+/* import-globals-from ../../../base/content/mailWindow.js */
 /* import-globals-from ../../../base/content/msgHdrView.js */
 
 var gSignedUINode = null;
 var gEncryptedUINode = null;
 var gSMIMEContainer = null;
 var gStatusBar = null;
 
 var gEncryptedURIService = null;