Bug 1478572 - Turn on ESLint by default in mail/components with some exceptions. r=aceman DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Sat, 15 Sep 2018 10:45:41 +1200
changeset 33155 09e76a937c343d2762a740fc5ba6a0529fabb008
parent 33154 7fed66ae20ae6fbad019248d8c7908aef7c23834
child 33156 9724c66105bfe2e18c68153f97c66f8f7e50edfa
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1478572
Bug 1478572 - Turn on ESLint by default in mail/components with some exceptions. r=aceman DONTBUILD
.eslintignore
mail/components/about-support/content/accounts.js
mail/components/aboutRedirector.js
mail/components/appIdleManager.js
mail/components/mailContentHandler.js
mail/components/mailGlue.js
mail/components/migration/content/migration.js
mail/components/nsMailDefaultHandler.js
mail/components/shell/nsSetDefaultMail.js
mail/components/test/unit/.eslintrc.js
mail/components/test/unit/test_about_support.js
mail/components/wintaskbar/windowsJumpLists.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -46,32 +46,28 @@ mailnews/test/*
 # mailnews/extensions exclusions
 mailnews/extensions/*
 !mailnews/extensions/newsblog
 
 # mail exclusions
 mail/app/**
 mail/base/**
 mail/branding/**
+mail/components/activity/**
+mail/components/cloudfile/**
+mail/components/compose/**
+mail/components/im/**
+mail/components/newmailaccount/**
+mail/components/search/**
 mail/config/**
 mail/extensions/**
 mail/installer/**
 mail/locales/**
 mail/test/**
 mail/themes/**
 
-# mail/components exclusions
-mail/components/*
-!mail/components/about-support
-!mail/components/accountcreation
-!mail/components/addrbook
-!mail/components/devtools
-!mail/components/downloads
-!mail/components/extensions
-!mail/components/preferences
-
 # calendar/ exclusions
 
 # prefs files
 calendar/lightning/content/lightning.js
 
 # third party library
 calendar/base/modules/ical.js
--- a/mail/components/about-support/content/accounts.js
+++ b/mail/components/about-support/content/accounts.js
@@ -1,18 +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/. */
 
-/* globals CLASS_DATA_PRIVATE, CLASS_DATA_PUBLIC, fixIterator, MailServices */
+/* globals CLASS_DATA_PRIVATE, CLASS_DATA_PUBLIC */
 
 "use strict";
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
-ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
+const { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Platform-specific includes
 if ("@mozilla.org/windows-registry-key;1" in Cc)
   ChromeUtils.import("resource:///modules/aboutSupportWin32.js");
 else if ("nsILocalFileMac" in Ci)
   ChromeUtils.import("resource:///modules/aboutSupportMac.js");
 else
--- a/mail/components/aboutRedirector.js
+++ b/mail/components/aboutRedirector.js
@@ -34,34 +34,34 @@ AboutRedirector.prototype = {
    * Gets the module name from the given URI.
    */
   _getModuleName: function AboutRedirector__getModuleName(aURI) {
     // Strip out the first ? or #, and anything following it
     let name = (/[^?#]+/.exec(aURI.pathQueryRef))[0];
     return name.toLowerCase();
   },
 
-  getURIFlags: function(aURI) {
+  getURIFlags(aURI) {
     let name = this._getModuleName(aURI);
     if (!(name in this._redirMap))
       throw Cr.NS_ERROR_ILLEGAL_VALUE;
     return this._redirMap[name].flags;
   },
 
-  newChannel: function(aURI, aLoadInfo) {
+  newChannel(aURI, aLoadInfo) {
     let name = this._getModuleName(aURI);
     if (!(name in this._redirMap))
       throw Cr.NS_ERROR_ILLEGAL_VALUE;
 
     let newURI = Services.io.newURI(this._redirMap[name].url);
     let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo);
     channel.originalURI = aURI;
 
     if (this._redirMap[name].flags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) {
       let principal = Services.scriptSecurityManager.createCodebasePrincipal(aURI, {});
       channel.owner = principal;
     }
 
     return channel;
-  }
+  },
 };
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutRedirector]);
--- a/mail/components/appIdleManager.js
+++ b/mail/components/appIdleManager.js
@@ -1,52 +1,47 @@
 /* -*- 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/. */
 
-this.EXPORTED_SYMBOLS = ['appIdleManager'];
+this.EXPORTED_SYMBOLS = ["appIdleManager"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // 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 =
 {
   _appIdle: false,
   _timerInterval: 5000, // 5 seconds ought to be plenty
-  get _timer()
-  {
+  get _timer() {
     delete this._timer;
     return this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   },
 
-  _timerCallback: function()
-  {
+  _timerCallback() {
     appIdleManager._appIdle = true;
     Services.obs.notifyObservers(null, "mail:appIdle", "idle");
 
   },
 
-  onBlur: function()
-  {
+  onBlur() {
     appIdleManager._timer.initWithCallback(appIdleManager._timerCallback,
                                  appIdleManager._timerInterval,
                                  Ci.nsITimer.TYPE_ONE_SHOT);
    },
 
-  onFocus: function()
-  {
+  onFocus() {
     appIdleManager._timer.cancel();
-    if (appIdleManager._appIdle)
-    {
+    if (appIdleManager._appIdle) {
       appIdleManager._appIdle = false;
       Services.obs.notifyObservers(null, "mail:appIdle", "back");
     }
-  }
+  },
 };
 
--- a/mail/components/mailContentHandler.js
+++ b/mail/components/mailContentHandler.js
@@ -12,17 +12,17 @@ function mailContentHandler() {
 mailContentHandler.prototype = {
   classID: Components.ID("{1c73f03a-b817-4640-b984-18c3478a9ae3}"),
 
   _xpcom_factory: {
     createInstance: function mch_factory_ci(outer, iid) {
       if (outer)
         throw Cr.NS_ERROR_NO_AGGREGATION;
       return gMailContentHandler.QueryInterface(iid);
-    }
+    },
   },
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIContentHandler]),
 
   openInExternal: function mch_OpenInExternal(uri) {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
       .loadURI(uri);
@@ -32,18 +32,17 @@ mailContentHandler.prototype = {
 
   handleContent: function mch_HandleContent(aContentType, aWindowContext,
                                             aRequest) {
     try {
       if (!Cc["@mozilla.org/webnavigation-info;1"]
              .getService(Ci.nsIWebNavigationInfo)
              .isTypeSupported(aContentType, null))
         throw NS_ERROR_WONT_HANDLE_CONTENT;
-    }
-    catch (e) {
+    } catch (e) {
       throw NS_ERROR_WONT_HANDLE_CONTENT;
     }
 
     aRequest.QueryInterface(Ci.nsIChannel);
 
     // For internal protocols (e.g. imap, mailbox, mailto), we want to handle
     // them internally as we know what to do. For http and https we don't
     // actually deal with external windows very well, so we redirect them to
@@ -60,13 +59,13 @@ mailContentHandler.prototype = {
     if (outer != null)
       throw Cr.NS_ERROR_NO_AGGREGATION;
 
     return this.QueryInterface(iid);
   },
 
   lockFactory: function mch_lock(lock) {
     // No-op.
-  }
+  },
 };
 var gMailContentHandler = new mailContentHandler();
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([mailContentHandler]);
--- a/mail/components/mailGlue.js
+++ b/mail/components/mailGlue.js
@@ -4,19 +4,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
 ChromeUtils.import("resource://gre/modules/LightweightThemeConsumer.jsm");
-ChromeUtils.import("resource:///modules/distribution.js");
-ChromeUtils.import("resource:///modules/mailMigrator.js");
-ChromeUtils.import("resource:///modules/extensionSupport.jsm");
+const { TBDistCustomizer } = ChromeUtils.import("resource:///modules/distribution.js", null);
+const { MailMigrator } = ChromeUtils.import("resource:///modules/mailMigrator.js", null);
+const {
+  ExtensionSupport,
+  extensionDefaults,
+} = ChromeUtils.import("resource:///modules/extensionSupport.jsm", null);
 const { L10nRegistry, FileSource } = ChromeUtils.import("resource://gre/modules/L10nRegistry.jsm", null);
 
 // lazy module getters
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
 });
 
@@ -66,29 +69,29 @@ MailGlue.prototype = {
       domWindow.document.documentElement.setAttribute("title", gMailBundle.GetStringFromName("errorConsoleTitle"));
       Services.scriptloader.loadSubScript("chrome://global/content/viewSourceUtils.js", domWindow);
     }
 
     ExtensionSupport.registerWindowListener(
       "Thunderbird-internal-BrowserConsole",
       {
         chromeURLs: [ "chrome://devtools/content/webconsole/browserconsole.xul" ],
-        onLoadWindow: _setupBrowserConsole
+        onLoadWindow: _setupBrowserConsole,
       });
 
     function _setupToolbox(domWindow) {
       // Defines openUILinkIn and openWebLinkIn
       Services.scriptloader.loadSubScript("chrome://communicator/content/contentAreaClick.js", domWindow);
     }
 
     ExtensionSupport.registerWindowListener(
       "Thunderbird-internal-Toolbox",
       {
         chromeURLs: [ "chrome://devtools/content/framework/toolbox-process-window.xul" ],
-        onLoadWindow: _setupToolbox
+        onLoadWindow: _setupToolbox,
       });
 
     ActorManagerParent.addActors(ACTORS);
     ActorManagerParent.flush();
   },
 
   // cleanup (called at shutdown)
   _dispose: function MailGlue__dispose() {
@@ -140,17 +143,17 @@ MailGlue.prototype = {
           Services.scriptloader.loadSubScript(
             "chrome://messenger/content/customElements.js", doc.ownerGlobal);
         }
       }, {once: true});
       break;
     }
   },
 
-  //nsIMailGlue implementation
+  // nsIMailGlue implementation
   sanitize: function MG_sanitize(aParentWindow) {
     this._sanitizer.sanitize(aParentWindow);
   },
 
   _onProfileStartup: function MailGlue__onProfileStartup() {
     TBDistCustomizer.applyPrefDefaults();
 
     let locales = Services.locale.getPackagedLocales();
@@ -191,17 +194,17 @@ MailGlue.prototype = {
       popup_text: "rgb(249, 249, 250)",
       popup_border: "#27272b",
       toolbar_field_text: "rgb(249, 249, 250)",
       toolbar_field_border: "rgba(249, 249, 250, 0.2)",
       sidebar: "#19191a",
       sidebar_text: "rgb(249, 249, 250)",
       author: vendorShortName,
     }, {
-      useInDarkMode: true
+      useInDarkMode: true,
     });
   },
 
  _offertToEnableAddons(aAddons) {
     let win = Services.wm.getMostRecentWindow("mail:3pane");
     let tabmail = win.document.getElementById("tabmail");
 
     aAddons.forEach(function(aAddon) {
@@ -210,27 +213,27 @@ MailGlue.prototype = {
       return;
 
     tabmail.openTab("contentTab",
                     { contentPage: "about:newaddon?id=" + aAddon.id,
                       clickHandler: null });
     });
   },
 
-  _detectNewSideloadedAddons: async function () {
+  async _detectNewSideloadedAddons() {
     let newSideloadedAddons = await AddonManagerPrivate.getNewSideloads();
     this._offertToEnableAddons(newSideloadedAddons);
   },
 
   _onMailStartupDone: function MailGlue__onMailStartupDone() {
     // On Windows 7 and above, initialize the jump list module.
     const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
     if (WINTASKBAR_CONTRACTID in Cc &&
         Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
-      ChromeUtils.import("resource:///modules/windowsJumpLists.js");
+      const { WinTaskbarJumpList } = ChromeUtils.import("resource:///modules/windowsJumpLists.js", null);
       WinTaskbarJumpList.startup();
     }
 
     // For any add-ons that were installed disabled and can be enabled, offer
     // them to the user.
     var changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED);
     AddonManager.getAddonsByIDs(changedIDs, this._offertToEnableAddons.bind(this));
 
@@ -251,18 +254,17 @@ MailGlue.prototype = {
           linkHandled.data = true;
           return;
         }
       }
 
       // If we didn't have an open 3 pane window, try and open one.
       Services.ww.openWindow(null, "chrome://messenger/content/", "_blank",
                              "chrome,dialog=no,all",
-                             { type: "contentTab",
-                               tabParams: tabParams });
+                             { type: "contentTab", tabParams });
       linkHandled.data = true;
     }
   },
 
   // for XPCOM
   classID: Components.ID("{eb239c82-fac9-431e-98d7-11cacd0f71b8}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsIMailGlue]),
--- a/mail/components/migration/content/migration.js
+++ b/mail/components/migration/content/migration.js
@@ -12,18 +12,17 @@ var nsISupportsString = Ci.nsISupportsSt
 var MigrationWizard = {
   _source: "",                  // Source Profile Migrator ContractID suffix
   _itemsFlags: kIMig.ALL,       // Selected Import Data Sources (16-bit bitfield)
   _selectedProfile: null,       // Selected Profile name to import from
   _wiz: null,
   _migrator: null,
   _autoMigrate: null,
 
-  init: function ()
-  {
+  init() {
     Services.obs.addObserver(this, "Migration:Started");
     Services.obs.addObserver(this, "Migration:ItemBeforeMigrate");
     Services.obs.addObserver(this, "Migration:ItemAfterMigrate");
     Services.obs.addObserver(this, "Migration:Ended");
     Services.obs.addObserver(this, "Migration:Progress");
 
     this._wiz = document.documentElement;
 
@@ -38,80 +37,75 @@ var MigrationWizard = {
       nothing.hidden = false;
     }
 
     this.onImportSourcePageShow();
 
     // Behavior alert! If we were given a migrator already, then we are going to perform migration
     // with that migrator, skip the wizard screen where we show all of the migration sources and
     // jump right into migration.
-    if (this._migrator)
-    {
-      if (this._migrator.sourceHasMultipleProfiles)
+    if (this._migrator) {
+      if (this._migrator.sourceHasMultipleProfiles) {
         this._wiz.goTo("selectProfile");
-      else
-      {
+      } else {
         var sourceProfiles = this._migrator.sourceProfiles;
         this._selectedProfile = sourceProfiles
           .queryElementAt(0, nsISupportsString).data;
         this._wiz.goTo("migrating");
       }
     }
   },
 
-  uninit: function ()
-  {
+  uninit() {
     Services.obs.removeObserver(this, "Migration:Started");
     Services.obs.removeObserver(this, "Migration:ItemBeforeMigrate");
     Services.obs.removeObserver(this, "Migration:ItemAfterMigrate");
     Services.obs.removeObserver(this, "Migration:Ended");
     Services.obs.removeObserver(this, "Migration:Progress");
   },
 
   // 1 - Import Source
-  onImportSourcePageShow: function ()
-  {
+  onImportSourcePageShow() {
     this._wiz.canRewind = false;
     this._wiz.canAdvance = false;
 
     // Figure out what source apps are are available to import from:
     var group = document.getElementById("importSourceGroup");
-    for (var i = 0; i < group.childNodes.length; ++i) {
-      var suffix = group.childNodes[i].id;
+    for (let childNode of group.childNodes) {
+      let suffix = childNode.id;
       if (suffix != "nothing") {
         var contractID = kProfileMigratorContractIDPrefix + suffix;
         var migrator = Cc[contractID].createInstance(kIMig);
         if (!migrator.sourceExists) {
-          group.childNodes[i].hidden = true;
+          childNode.hidden = true;
           if (this._source == suffix) this._source = null;
         }
       }
     }
 
     var firstNonDisabled = null;
-    for (var i = 0; i < group.childNodes.length; ++i) {
-    if (!group.childNodes[i].hidden && !group.childNodes[i].disabled) {
-        firstNonDisabled = group.childNodes[i];
+    for (let childNode of group.childNodes) {
+      if (!childNode.hidden && !childNode.disabled) {
+        firstNonDisabled = childNode;
         break;
       }
     }
     group.selectedItem = this._source == "" ? firstNonDisabled : document.getElementById(this._source);
 
     if (firstNonDisabled) {
       this._wiz.canAdvance = true;
     } else {
       // If no usable import module was found, inform user and enable back button.
       document.getElementById("importSourceFound").selectedIndex = 1;
       this._wiz.canRewind = true;
       this._wiz.getButton("back").setAttribute("hidden", "false");
     }
   },
 
-  onImportSourcePageAdvanced: function ()
-  {
+  onImportSourcePageAdvanced() {
     var newSource = document.getElementById("importSourceGroup").selectedItem.id;
 
     if (newSource == "nothing") {
       document.documentElement.cancel();
       return;
     }
 
     if (!this._migrator || (newSource != this._source)) {
@@ -135,18 +129,17 @@ var MigrationWizard = {
         this._selectedProfile =
           sourceProfiles.queryElementAt(0, nsISupportsString).data;
       else
         this._selectedProfile = "";
     }
   },
 
   // 2 - [Profile Selection]
-  onSelectProfilePageShow: function ()
-  {
+  onSelectProfilePageShow() {
     // Disabling this for now, since we ask about import sources in automigration
     // too and don't want to disable the back button
     // if (this._autoMigrate)
     //   document.documentElement.getButton("back").disabled = true;
 
     var profiles = document.getElementById("profiles");
     while (profiles.hasChildNodes())
       profiles.lastChild.remove();
@@ -161,35 +154,32 @@ var MigrationWizard = {
       item.id = sourceProfiles.queryElementAt(i, nsISupportsString).data;
       item.setAttribute("label", item.id);
       profiles.appendChild(item);
     }
 
     profiles.selectedItem = this._selectedProfile ? document.getElementById(this._selectedProfile) : profiles.firstChild;
   },
 
-  onSelectProfilePageRewound: function ()
-  {
+  onSelectProfilePageRewound() {
     var profiles = document.getElementById("profiles");
     this._selectedProfile = profiles.selectedItem.id;
   },
 
-  onSelectProfilePageAdvanced: function ()
-  {
+  onSelectProfilePageAdvanced() {
     var profiles = document.getElementById("profiles");
     this._selectedProfile = profiles.selectedItem.id;
 
     // If we're automigrating, don't show the item selection page, just grab everything.
     if (this._autoMigrate)
       this._wiz.currentPage.next = "migrating";
   },
 
   // 3 - ImportItems
-  onImportItemsPageShow: function ()
-  {
+  onImportItemsPageShow() {
     var dataSources = document.getElementById("dataSources");
     while (dataSources.hasChildNodes())
       dataSources.lastChild.remove();
 
     var bundle = document.getElementById("bundle");
 
     var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
     for (var i = 0; i < 16; ++i) {
@@ -200,148 +190,138 @@ var MigrationWizard = {
         checkbox.setAttribute("label", bundle.getString(itemID + "_" + this._source));
         dataSources.appendChild(checkbox);
         if (!this._itemsFlags || this._itemsFlags & itemID)
           checkbox.checked = true;
       }
     }
   },
 
-  onImportItemsPageAdvanced: function ()
-  {
+  onImportItemsPageAdvanced() {
     var dataSources = document.getElementById("dataSources");
     this._itemsFlags = 0;
     for (var i = 0; i < dataSources.childNodes.length; ++i) {
       var checkbox = dataSources.childNodes[i];
       if (checkbox.localName == "checkbox" && checkbox.checked)
         this._itemsFlags |= parseInt(checkbox.id);
     }
   },
 
-  onImportItemCommand: function (aEvent)
-  {
+  onImportItemCommand(aEvent) {
     var items = document.getElementById("dataSources");
     var checkboxes = items.getElementsByTagName("checkbox");
 
     var oneChecked = false;
     for (var i = 0; i < checkboxes.length; ++i) {
       if (checkboxes[i].checked) {
         oneChecked = true;
         break;
       }
     }
 
     this._wiz.canAdvance = oneChecked;
   },
 
   // 4 - Migrating
-  onMigratingPageShow: function ()
-  {
+  onMigratingPageShow() {
     this._wiz.getButton("cancel").disabled = true;
     this._wiz.canRewind = false;
     this._wiz.canAdvance = false;
 
     // When automigrating or migrating all, show all of the data that can
     // be received from this source.
     if (this._autoMigrate || this._itemsFlags == kIMig.ALL)
       this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile,
                                                        this._autoMigrate);
 
     this._listItems("migratingItems");
     setTimeout(this.onMigratingMigrate, 0, this);
   },
 
-  onMigratingMigrate: function (aOuter)
-  {
+  onMigratingMigrate(aOuter) {
     aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile);
   },
 
-  _listItems: function (aID)
-  {
+  _listItems(aID) {
     var items = document.getElementById(aID);
     while (items.hasChildNodes())
       items.lastChild.remove();
 
     var bundle = document.getElementById("bundle");
-    var itemID;
     for (var i = 0; i < 16; ++i) {
       var itemID = (this._itemsFlags >> i) & 0x1 ? Math.pow(2, i) : 0;
       if (itemID > 0) {
         var label = document.createElement("label");
         label.id = itemID + "_migrated";
         try {
           label.setAttribute("value", "- " + bundle.getString(itemID + "_" + this._source));
           items.appendChild(label);
-        }
-        catch (e) {
+        } catch (e) {
           // if the block above throws, we've enumerated all the import data types we
           // currently support and are now just wasting time, break.
           break;
         }
       }
     }
   },
 
-  observe: function (aSubject, aTopic, aData)
-  {
+  observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "Migration:Started":
       dump("*** started\n");
       break;
-    case "Migration:ItemBeforeMigrate":
+    case "Migration:ItemBeforeMigrate": {
       dump("*** before " + aData + "\n");
-      var label = document.getElementById(aData + "_migrated");
+      let label = document.getElementById(aData + "_migrated");
       if (label)
         label.setAttribute("style", "font-weight: bold");
       break;
-    case "Migration:ItemAfterMigrate":
+    }
+    case "Migration:ItemAfterMigrate": {
       dump("*** after " + aData + "\n");
-      var label = document.getElementById(aData + "_migrated");
+      let label = document.getElementById(aData + "_migrated");
       if (label)
         label.removeAttribute("style");
       break;
+    }
     case "Migration:Ended":
       dump("*** done\n");
       if (this._autoMigrate) {
         // We're done now.
         this._wiz.canAdvance = true;
         this._wiz.advance();
         setTimeout(window.close, 5000);
-      }
-      else {
+      } else {
         this._wiz.canAdvance = true;
         var nextButton = this._wiz.getButton("next");
         nextButton.click();
       }
       break;
     case "Migration:Progress":
-      document.getElementById('progressBar').value = aData;
+      document.getElementById("progressBar").value = aData;
       break;
     }
   },
 
-  onDonePageShow: function ()
-  {
+  onDonePageShow() {
     this._wiz.getButton("cancel").disabled = true;
     this._wiz.canRewind = false;
     this._listItems("doneItems");
   },
 
-  onBack: function ()
-  {
+  onBack() {
     if (this._wiz.onFirstPage) {
       if (window.arguments[3])
         window.arguments[3].closeMigration = false;
       this._wiz.cancel();
     } else {
       this._wiz.rewind();
     }
   },
 
-  onCancel: function ()
-  {
+  onCancel() {
     // If .closeMigration is false, the user clicked Back button,
     // then do not change its value.
     if (window.arguments[3] && ("closeMigration" in window.arguments[3]) &&
         (window.arguments[3].closeMigration !== false))
       window.arguments[3].closeMigration = true;
-  }
+  },
 };
--- a/mail/components/nsMailDefaultHandler.js
+++ b/mail/components/nsMailDefaultHandler.js
@@ -3,54 +3,39 @@
  * 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://gre/modules/NetUtil.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
-var nsISupports              = Ci.nsISupports;
-
-var nsICommandLine           = Ci.nsICommandLine;
-var nsICommandLineHandler    = Ci.nsICommandLineHandler;
-var nsICommandLineValidator  = Ci.nsICommandLineValidator;
-var nsIFactory               = Ci.nsIFactory;
-var nsIFileURL               = Ci.nsIFileURL;
-var nsINetUtil               = Ci.nsINetUtil;
-var nsISupportsString        = Ci.nsISupportsString;
-var nsIURILoader             = Ci.nsIURILoader;
-
-var NS_ERROR_ABORT = Cr.NS_ERROR_ABORT;
-
 var URI_INHERITS_SECURITY_CONTEXT = Ci.nsIProtocolHandler
-                                        .URI_INHERITS_SECURITY_CONTEXT;
+                                      .URI_INHERITS_SECURITY_CONTEXT;
 
 function resolveURIInternal(aCmdLine, aArgument) {
   var uri = aCmdLine.resolveURI(aArgument);
 
-  if (!(uri instanceof nsIFileURL)) {
+  if (!(uri instanceof Ci.nsIFileURL)) {
     return uri;
   }
 
   try {
     if (uri.file.exists())
       return uri;
-  }
-  catch (e) {
+  } catch (e) {
     Cu.reportError(e);
   }
 
   // We have interpreted the argument as a relative file URI, but the file
   // doesn't exist. Try URI fixup heuristics: see bug 290782.
 
   try {
     uri = Services.uriFixup.createFixupURI(aArgument, 0);
-  }
-  catch (e) {
+  } catch (e) {
     Cu.reportError(e);
   }
 
   return uri;
 }
 
 function handleIndexerResult(aFile) {
   // Do this here because xpcshell isn't too happy with this at startup
@@ -65,26 +50,24 @@ function handleIndexerResult(aFile) {
 
   // If we found a message header, open it, otherwise throw an exception
   if (msgHdr)
     MailUtils.displayMessage(msgHdr);
   else
     throw Cr.NS_ERROR_FAILURE;
 }
 
-function mayOpenURI(uri)
-{
+function mayOpenURI(uri) {
   var ext = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService);
 
   return ext.isExposedProtocol(uri.scheme);
 }
 
-function openURI(uri)
-{
+function openURI(uri) {
   if (!mayOpenURI(uri))
     throw Cr.NS_ERROR_FAILURE;
 
   var channel = Services.io.newChannelFromURI2(uri,
                                                null,
                                                Services.scriptSecurityManager.getSystemPrincipal(),
                                                null,
                                                Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
@@ -94,159 +77,153 @@ function openURI(uri)
 
   // We cannot load a URI on startup asynchronously without protecting
   // the startup
 
   var loadgroup = Cc["@mozilla.org/network/load-group;1"]
                     .createInstance(Ci.nsILoadGroup);
 
   var loadlistener = {
-    onStartRequest: function ll_start(aRequest, aContext) {
+    onStartRequest(aRequest, aContext) {
       Services.startup.enterLastWindowClosingSurvivalArea();
     },
 
-    onStopRequest: function ll_stop(aRequest, aContext, aStatusCode) {
+    onStopRequest(aRequest, aContext, aStatusCode) {
       Services.startup.exitLastWindowClosingSurvivalArea();
     },
 
     QueryInterface: ChromeUtils.generateQI([Ci.nsIRequestObserver,
-                                            Ci.nsISupportsWeakReference])
+                                            Ci.nsISupportsWeakReference]),
   };
 
   loadgroup.groupObserver = loadlistener;
 
   var listener = {
-    onStartURIOpen: function(uri) { return false; },
-    doContent: function(ctype, preferred, request, handler) {
+    onStartURIOpen(uri) { return false; },
+    doContent(ctype, preferred, request, handler) {
       var newHandler = Cc["@mozilla.org/uriloader/content-handler;1?type=application/x-message-display"]
                          .createInstance(Ci.nsIContentHandler);
       newHandler.handleContent("application/x-message-display", this, request);
       return true;
     },
-    isPreferred: function(ctype, desired) {
+    isPreferred(ctype, desired) {
       if (ctype == "message/rfc822")
         return true;
       return false;
     },
-    canHandleContent: function(ctype, preferred, desired) { return false; },
+    canHandleContent(ctype, preferred, desired) { return false; },
     loadCookie: null,
     parentContentListener: null,
-    getInterface: function(iid) {
+    getInterface(iid) {
       if (iid.equals(Ci.nsIURIContentListener))
         return this;
 
       if (iid.equals(Ci.nsILoadGroup))
         return loadgroup;
 
       throw Cr.NS_ERROR_NO_INTERFACE;
-    }
+    },
   };
   loader.openURI(channel, true, listener);
 }
 
 var nsMailDefaultHandler = {
-  QueryInterface: ChromeUtils.generateQI([nsICommandLineHandler,
-                                          nsICommandLineValidator,
-                                          nsIFactory]),
+  QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler,
+                                          Ci.nsICommandLineValidator,
+                                          Ci.nsIFactory]),
 
   /* nsICommandLineHandler */
 
-  handle : function mdh_handle(cmdLine) {
+  /* eslint-disable complexity */
+  handle(cmdLine) {
     var uri;
 
     try {
       var remoteCommand = cmdLine.handleFlagWithParam("remote", true);
-    }
-    catch (e) {
-      throw NS_ERROR_ABORT;
+    } catch (e) {
+      throw Cr.NS_ERROR_ABORT;
     }
 
     if (remoteCommand != null) {
       try {
         var a = /^\s*(\w+)\(([^\)]*)\)\s*$/.exec(remoteCommand);
         var remoteVerb = a[1].toLowerCase();
         var remoteParams = a[2].split(",");
 
         switch (remoteVerb) {
-        case "openurl":
-          var xuri = cmdLine.resolveURI(remoteParams[0]);
+        case "openurl": {
+          let xuri = cmdLine.resolveURI(remoteParams[0]);
           openURI(xuri);
           break;
-
-        case "mailto":
-          var xuri = cmdLine.resolveURI("mailto:" + remoteParams[0]);
+        }
+        case "mailto": {
+          let xuri = cmdLine.resolveURI("mailto:" + remoteParams[0]);
           openURI(xuri);
           break;
-
+        }
         case "xfedocommand":
           // xfeDoCommand(openBrowser)
           switch (remoteParams[0].toLowerCase()) {
-          case "openinbox":
+          case "openinbox": {
             var win = Services.wm.getMostRecentWindow("mail:3pane");
             if (win) {
               win.focus();
-            }
-            else {
+            } else {
               // Bug 277798 - we have to pass an argument to openWindow(), or
               // else it won't honor the dialog=no instruction.
-              var argstring = Cc["@mozilla.org/supports-string;1"]
-                                .createInstance(nsISupportsString);
+              let argstring = Cc["@mozilla.org/supports-string;1"]
+                                .createInstance(Ci.nsISupportsString);
               Services.ww.openWindow(null, "chrome://messenger/content/", "_blank",
                                      "chrome,dialog=no,all", argstring);
             }
             break;
-
-          case "composemessage":
-            var argstring = Cc["@mozilla.org/supports-string;1"]
-                              .createInstance(nsISupportsString);
+          }
+          case "composemessage": {
+            let argstring = Cc["@mozilla.org/supports-string;1"]
+                              .createInstance(Ci.nsISupportsString);
             remoteParams.shift();
             argstring.data = remoteParams.join(",");
             Services.ww.openWindow(null, "chrome://messenger/content/messengercompose/messengercompose.xul",
                                    "_blank", "chrome,dialog=no,all", argstring);
             break;
-
+          }
           default:
             throw Cr.NS_ERROR_ABORT;
           }
           break;
 
         default:
           // Somebody sent us a remote command we don't know how to process:
           // just abort.
           throw Cr.NS_ERROR_ABORT;
         }
 
         cmdLine.preventDefault = true;
-      }
-      catch (e) {
+      } catch (e) {
         // If we had a -remote flag but failed to process it, throw
         // NS_ERROR_ABORT so that the xremote code knows to return a failure
         // back to the handling code.
         dump(e);
         throw Cr.NS_ERROR_ABORT;
       }
     }
 
     var chromeParam = cmdLine.handleFlagWithParam("chrome", false);
     if (chromeParam) {
       try {
-        var features = "chrome,dialog=no,all";
-        var argstring = Cc["@mozilla.org/supports-string;1"]
-                          .createInstance(nsISupportsString);
-        var uri = resolveURIInternal(cmdLine, chromeParam);
-        var netutil = Cc["@mozilla.org/network/util;1"]
-                        .getService(nsINetUtil);
+        let argstring = Cc["@mozilla.org/supports-string;1"]
+                          .createInstance(Ci.nsISupportsString);
+        let _uri = resolveURIInternal(cmdLine, chromeParam);
         // only load URIs which do not inherit chrome privs
-        if (!netutil.URIChainHasFlags(uri, URI_INHERITS_SECURITY_CONTEXT)) {
-          Services.ww.openWindow(null, uri.spec, "_blank",
+        if (!Services.netUtils.URIChainHasFlags(_uri, URI_INHERITS_SECURITY_CONTEXT)) {
+          Services.ww.openWindow(null, _uri.spec, "_blank",
                                  "chrome,dialog=no,all", argstring);
           cmdLine.preventDefault = true;
         }
-      }
-      catch (e) {
+      } catch (e) {
         dump(e);
       }
     }
 
     if (cmdLine.handleFlag("silent", false)) {
       cmdLine.preventDefault = true;
     }
 
@@ -269,17 +246,17 @@ var nsMailDefaultHandler = {
     var count = cmdLine.length;
     if (count) {
       var i = 0;
       while (i < count) {
         var curarg = cmdLine.getArgument(i);
         if (!curarg.startsWith("-"))
           break;
 
-        dump ("Warning: unrecognized command line flag " + curarg + "\n");
+        dump("Warning: unrecognized command line flag " + curarg + "\n");
         // To emulate the pre-nsICommandLine behavior, we ignore the
         // argument after an unrecognized flag.
         i += 2;
         // xxxbsmedberg: make me use the console service!
       }
 
       if (i < count) {
         uri = cmdLine.getArgument(i);
@@ -296,78 +273,72 @@ var nsMailDefaultHandler = {
           }
         }
       }
     }
 
     if (!uri && cmdLine.preventDefault)
       return;
 
-    if (!uri && cmdLine.state != nsICommandLine.STATE_INITIAL_LAUNCH) {
+    if (!uri && cmdLine.state != Ci.nsICommandLine.STATE_INITIAL_LAUNCH) {
       try {
         var wlist = Services.wm.getEnumerator("mail:3pane");
         if (wlist.hasMoreElements()) {
-          var window = wlist.getNext().QueryInterface(nsIDOMWindow);
+          var window = wlist.getNext().QueryInterface(Ci.nsIDOMWindow);
           window.focus();
           return;
         }
-      }
-      catch (e) {
+      } catch (e) {
         dump(e);
       }
     }
 
     if (uri) {
       if (uri.toLowerCase().startsWith("feed:")) {
         try {
           Cc["@mozilla.org/newsblog-feed-downloader;1"]
             .getService(Ci.nsINewsBlogFeedDownloader)
             .subscribeToFeed(uri, null, null);
-        }
-        catch (e) {
+        } catch (e) {
           // If feed handling is not installed, do nothing
         }
-      }
-      else if (uri.toLowerCase().endsWith(".mozeml") || uri.toLowerCase().endsWith(".wdseml")) {
+      } else if (uri.toLowerCase().endsWith(".mozeml") ||
+                 uri.toLowerCase().endsWith(".wdseml")) {
         handleIndexerResult(cmdLine.resolveFile(uri));
         cmdLine.preventDefault = true;
-      }
-      else if (uri.toLowerCase().endsWith(".eml")) {
+      } else if (uri.toLowerCase().endsWith(".eml")) {
         // Open this eml in a new message window
         let file = cmdLine.resolveFile(uri);
         // No point in trying to open a file if it doesn't exist or is empty
         if (file.exists() && file.fileSize > 0) {
           // Get the URL for this file
           let fileURL = Services.io.newFileURI(file)
                                 .QueryInterface(Ci.nsIFileURL);
           fileURL = fileURL.mutate().setQuery("type=application/x-message-display").finalize();
 
           Services.ww.openWindow(null,
                                  "chrome://messenger/content/messageWindow.xul",
                                  "_blank", "all,chrome,dialog=no,status,toolbar",
                                  fileURL);
           cmdLine.preventDefault = true;
-        }
-        else {
+        } else {
           let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
           let title, message;
           if (!file.exists()) {
             title = bundle.GetStringFromName("fileNotFoundTitle");
             message = bundle.formatStringFromName("fileNotFoundMsg", [file.path], 1);
-          }
-          else {
+          } else {
             // The file is empty
             title = bundle.GetStringFromName("fileEmptyTitle");
             message = bundle.formatStringFromName("fileEmptyMsg", [file.path], 1);
           }
 
           Services.prompt.alert(null, title, message);
         }
-      }
-      else if (uri.toLowerCase().endsWith(".vcf")) {
+      } else if (uri.toLowerCase().endsWith(".vcf")) {
         // A VCard! Be smart and open the "add contact" dialog.
         let file = cmdLine.resolveFile(uri);
         if (file.exists() && file.fileSize > 0) {
           let uriSpec = Services.io.newFileURI(file).spec;
           NetUtil.asyncFetch({uri: uriSpec, loadUsingSystemPrincipal: true},
             function(inputStream, status) {
               if (!Components.isSuccessCode(status)) {
                 return;
@@ -379,18 +350,17 @@ var nsMailDefaultHandler = {
               Services.ww.openWindow(
                 null,
                 "chrome://messenger/content/addressbook/abNewCardDialog.xul",
                 "_blank",
                 "chrome,resizable=no,titlebar,modal,centerscreen",
                 card);
           });
         }
-      }
-      else {
+      } else {
         // This must be a regular filename. Use it to create a new message with attachment.
         let msgParams = Cc["@mozilla.org/messengercompose/composeparams;1"]
                           .createInstance(Ci.nsIMsgComposeParams);
         let composeFields = Cc["@mozilla.org/messengercompose/composefields;1"]
                               .createInstance(Ci.nsIMsgCompFields);
         let attachment = Cc["@mozilla.org/messengercompose/attachment;1"]
                            .createInstance(Ci.nsIMsgAttachment);
         let localFile = Cc["@mozilla.org/file/local;1"]
@@ -410,25 +380,26 @@ var nsMailDefaultHandler = {
 
           MailServices.compose.OpenComposeWindowWithParams(null, msgParams);
         } catch (e) {
           openURI(cmdLine.resolveURI(uri));
         }
       }
     } else {
       var argstring = Cc["@mozilla.org/supports-string;1"]
-                        .createInstance(nsISupportsString);
+                        .createInstance(Ci.nsISupportsString);
 
       Services.ww.openWindow(null, "chrome://messenger/content/", "_blank",
                              "chrome,dialog=no,all", argstring);
     }
   },
+  /* eslint-enable complexity */
 
   /* nsICommandLineValidator */
-  validate : function mdh_validate(cmdLine) {
+  validate(cmdLine) {
     var osintFlagIdx = cmdLine.findFlag("osint", false);
     if (osintFlagIdx == -1)
       return;
 
     // Other handlers may use osint so only handle the osint flag if the mail
     // or compose flag is also present and the command line is valid.
     var mailFlagIdx = cmdLine.findFlag("mail", false);
     var composeFlagIdx = cmdLine.findFlag("compose", false);
@@ -441,43 +412,43 @@ var nsMailDefaultHandler = {
       var actionFlagIdx = mailFlagIdx > composeFlagIdx ? composeFlagIdx : mailFlagIdx;
     else
       actionFlagIdx = mailFlagIdx > -1 ? mailFlagIdx : composeFlagIdx;
 
     if (actionFlagIdx && (osintFlagIdx > -1)) {
       var param = cmdLine.getArgument(actionFlagIdx + 1);
       if (cmdLine.length != actionFlagIdx + 2 ||
           /thunderbird.url.(mailto|news):/.test(param))
-        throw NS_ERROR_ABORT;
-      cmdLine.handleFlag("osint", false)
+        throw Cr.NS_ERROR_ABORT;
+      cmdLine.handleFlag("osint", false);
     }
   },
 
-  helpInfo : "  -options           Open the options dialog.\n" +
-             "  -file              Open the specified email file.\n",
+  helpInfo: "  -options           Open the options dialog.\n" +
+            "  -file              Open the specified email file.\n",
 
   /* nsIFactory */
 
-  createInstance : function mdh_CI(outer, iid) {
+  createInstance(outer, iid) {
     if (outer != null)
       throw Cr.NS_ERROR_NO_AGGREGATION;
 
     return this.QueryInterface(iid);
   },
 
-  lockFactory : function mdh_lock(lock) {
+  lockFactory(lock) {
     /* no-op */
-  }
+  },
 };
 
 function mailDefaultCommandLineHandler() {}
 
 mailDefaultCommandLineHandler.prototype = {
   classDescription: "Mail default commandline handler",
   classID: Components.ID("{44346520-c5d2-44e5-a1ec-034e04d7fac4}"),
   contractID: "@mozilla.org/mail/clh;1",
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIModule]),
 
-  _xpcom_factory: nsMailDefaultHandler
-}
+  _xpcom_factory: nsMailDefaultHandler,
+};
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([mailDefaultCommandLineHandler]);
--- a/mail/components/shell/nsSetDefaultMail.js
+++ b/mail/components/shell/nsSetDefaultMail.js
@@ -15,21 +15,21 @@ ChromeUtils.import("resource://gre/modul
 function nsSetDefaultMail() {
 }
 
 nsSetDefaultMail.prototype = {
   /* nsISupports */
   QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler]),
 
   /* nsICommandLineHandler */
-  handle : function nsSetDefault_handle(cmdline) {
+  handle(cmdline) {
     if (cmdline.handleFlag("setDefaultMail", false)) {
       var shell = Cc["@mozilla.org/mail/shell-service;1"].
                   getService(Ci.nsIShellService);
       shell.setDefaultClient(true, Ci.nsIShellService.MAIL);
     }
   },
 
-  helpInfo : "  -setDefaultMail    Set this app as the default mail client.\n",
-  classID: Components.ID("{ED117D0A-F6C2-47d8-8A71-0E15BABD2554}")
+  helpInfo: "  -setDefaultMail    Set this app as the default mail client.\n",
+  classID: Components.ID("{ED117D0A-F6C2-47d8-8A71-0E15BABD2554}"),
 };
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultMail]);
new file mode 100644
--- /dev/null
+++ b/mail/components/test/unit/.eslintrc.js
@@ -0,0 +1,8 @@
+"use strict";
+/* eslint-env node */
+
+module.exports = {
+    "extends": [
+        "plugin:mozilla/xpcshell-test",
+    ],
+};
--- a/mail/components/test/unit/test_about_support.js
+++ b/mail/components/test/unit/test_about_support.js
@@ -1,12 +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/. */
 
+// mail/components/about-support/content/accounts.js
+/* globals AboutSupport, AboutSupportPlatform */
+
 ChromeUtils.import("resource://testing-common/mailnews/localAccountUtils.js");
 
 /*
  * Test the about:support module.
  */
 
 var gAccountList = [{
   type: "pop3",
@@ -50,19 +53,19 @@ var gAccountList = [{
     user: "newsout2",
     password: "newsoutpassword2",
     isDefault: false,
     socketType: Ci.nsMsgSocketType.SSL,
     authMethod: Ci.nsMsgAuthMethod.External,
   }],
 }];
 
-/// A map of account keys to servers. Populated by setup_accounts.
+// A map of account keys to servers. Populated by setup_accounts.
 var gAccountMap = {};
-/// A map of SMTP server names to SMTP servers. Populated by setup_accounts.
+// A map of SMTP server names to SMTP servers. Populated by setup_accounts.
 var gSMTPMap = {};
 
 /**
  * A list of sensitive data: it shouldn't be present in the account
  * details. Populated by setup_accounts.
  */
 var gSensitiveData = [];
 
--- a/mail/components/wintaskbar/windowsJumpLists.js
+++ b/mail/components/wintaskbar/windowsJumpLists.js
@@ -2,24 +2,24 @@
 /* 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/. */
 
 var EXPORTED_SYMBOLS = ["WinTaskbarJumpList"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
+const { toXPCOMArray } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 
 // Prefs
 var PREF_TASKBAR_BRANCH    = "mail.taskbar.lists.";
 var PREF_TASKBAR_ENABLED   = "enabled";
 var PREF_TASKBAR_TASKS     = "tasks.enabled";
 
-XPCOMUtils.defineLazyGetter(this, "_stringBundle", function () {
+XPCOMUtils.defineLazyGetter(this, "_stringBundle", function() {
   return Services.strings
                  .createBundle("chrome://messenger/locale/taskbar.properties");
 });
 
 XPCOMUtils.defineLazyServiceGetter(this, "_taskbarService",
                                    "@mozilla.org/windows-taskbar;1",
                                    "nsIWinTaskbar");
 
@@ -32,28 +32,28 @@ function _getString(aName) {
 }
 
 /**
  * Task list
  */
 var gTasks = [
   // Write new message
   {
-    get title()       { return _getString("taskbar.tasks.composeMessage.label"); },
+    get title() { return _getString("taskbar.tasks.composeMessage.label"); },
     get description() { return _getString("taskbar.tasks.composeMessage.description"); },
-    args:             "-compose",
-    iconIndex:        2, // Write message icon
+    args: "-compose",
+    iconIndex: 2, // Write message icon
   },
 
   // Open address book
   {
-    get title()       { return _getString("taskbar.tasks.openAddressBook.label"); },
+    get title() { return _getString("taskbar.tasks.openAddressBook.label"); },
     get description() { return _getString("taskbar.tasks.openAddressBook.description"); },
-    args:             "-addressbook",
-    iconIndex:        3, // Open address book icon
+    args: "-addressbook",
+    iconIndex: 3, // Open address book icon
   },
 ];
 
 
 var WinTaskbarJumpList = {
 
   /**
    * Startup, shutdown, and update
@@ -209,17 +209,17 @@ var WinTaskbarJumpList = {
   _freeObs: function WTBJL__freeObs() {
     Services.obs.removeObserver(this, "profile-before-change");
     _prefs.removeObserver("", this);
   },
 
   observe: function WTBJL_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
-        if (this._enabled == true && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
+        if (this._enabled && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
           this._deleteActiveJumpList();
         this._refreshPrefs();
         this.update();
       break;
 
       case "profile-before-change":
         this._shutdown();
       break;