Bug 1488607 - Adapt to ESLint rule changes in bug 1488445. r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 05 Sep 2018 11:53:04 +1200
changeset 33077 4a2af5ca975ba0eb97127e833ab35fb091086ef3
parent 33076 02dad197889f49d0fefb60d504120044f297a71b
child 33078 ed7240d36fb533b18059d841c60c6f2ab72a73f9
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersjorgk
bugs1488607, 1488445
Bug 1488607 - Adapt to ESLint rule changes in bug 1488445. r=jorgk
mail/components/addrbook/content/abCommon.js
mail/components/addrbook/content/abContactsPanel.js
mail/components/addrbook/content/addressbook.js
mailnews/.eslintrc.js
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -644,17 +644,17 @@ function DirPaneDoubleClick(event) {
   }
 }
 
 function DirPaneSelectionChange() {
   let uri = getSelectedDirectoryURI();
   // clear out the search box when changing folders...
   onAbClearSearch(false);
   if (gDirTree && gDirTree.view.selection && gDirTree.view.selection.count == 1) {
-    gPreviousDirTreeIndex = gDirTree.currentIndex; // eslint-disable-line no-native-reassign
+    gPreviousDirTreeIndex = gDirTree.currentIndex; // eslint-disable-line no-global-assign
     ChangeDirectoryByURI(uri);
     document.getElementById("localResultsOnlyMessage")
             .setAttribute("hidden",
                           !gDirectoryTreeView.hasRemoteAB ||
                           uri != kAllDirectoryRoot + "?");
   }
 
   goUpdateCommand("cmd_newlist");
--- a/mail/components/addrbook/content/abContactsPanel.js
+++ b/mail/components/addrbook/content/abContactsPanel.js
@@ -206,19 +206,19 @@ function CommandUpdate_AddressBook() {
   goUpdateCommand("cmd_delete");
   goUpdateCommand("cmd_properties");
 }
 
 function onEnterInSearchBar() {
   if (!gQueryURIFormat) {
     // Get model query from pref. We don't want the query starting with "?"
     // as we have to prefix "?and" to this format.
-    /* eslint-disable no-native-reassign */
+    /* eslint-disable no-global-assign */
     gQueryURIFormat = getModelQuery("mail.addr_book.quicksearchquery.format");
-    /* eslint-enable no-native-reassign */
+    /* eslint-enable no-global-assign */
   }
 
   let searchURI = getSelectedDirectoryURI();
   let searchInput = document.getElementById("peopleSearchInput");
 
   // Use helper method to split up search query to multi-word search
   // query against multiple fields.
   if (searchInput) {
--- a/mail/components/addrbook/content/addressbook.js
+++ b/mail/components/addrbook/content/addressbook.js
@@ -359,23 +359,23 @@ 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-native-reassign */
+  /* 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-native-reassign */
+  /* eslint-enable no-global-assign */
 }
 
 function AbPrintCard() {
   AbPrintCardInternal(false, Ci.nsIMsgPrintEngine.MNAB_PRINT_AB_CARD);
 }
 
 function AbPrintPreviewCard() {
   AbPrintCardInternal(true, Ci.nsIMsgPrintEngine.MNAB_PRINTPREVIEW_AB_CARD);
@@ -397,22 +397,22 @@ 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-native-reassign */
+  /* eslint-disable no-global-assign */
   printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul",
                     "",
                     "chrome,dialog=no,all",
                     1, [printUrl], statusFeedback, doPrintPreview, msgType);
-  /* eslint-enable no-native-reassign */
+  /* eslint-enable no-global-assign */
 }
 
 function AbPrintAddressBook() {
   AbPrintAddressBookInternal(false, Ci.nsIMsgPrintEngine.MNAB_PRINT_ADDRBOOK);
 }
 
 function AbPrintPreviewAddressBook() {
   AbPrintAddressBookInternal(true, Ci.nsIMsgPrintEngine.MNAB_PRINTPREVIEW_ADDRBOOK);
--- a/mailnews/.eslintrc.js
+++ b/mailnews/.eslintrc.js
@@ -7,19 +7,16 @@ module.exports = { // eslint-disable-lin
     "MsgHdrToMimeMessage": true,
     "ReloadMessage": true,
     "Services": true,
     "gDBView": true,
     "getBrowser": true,
   },
 
   "rules": {
-    // Require trailing commas for easy list extension and consistent style.
-    "comma-dangle": ["error", "always-multiline"],
-
     // Require braces around blocks that start a new line.
     "curly": ["error", "multi-line"],
 
     // Enforce valid JSDoc comments.
     "valid-jsdoc": ["error", {
       prefer: { return: "returns" },
       preferType: {
         "boolean": "Boolean",