Bug 1504130 - Set environment of .eslintrc.js files to node; also fix two warnings; rs=NPOTB
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 02 Nov 2018 21:04:58 +1300
changeset 33645 392208e3b586f1022d8b8e4a540ee49a3d215ff3
parent 33644 fa7b4b68119e8a24335b103eca102c6315d672cf
child 33646 8b5b4aa261935a671fcec24cb9f6249f72555fad
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersNPOTB
bugs1504130
Bug 1504130 - Set environment of .eslintrc.js files to node; also fix two warnings; rs=NPOTB
.eslintrc.js
calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
mail/base/test/unit/.eslintrc.js
mail/components/accountcreation/content/.eslintrc.js
mail/components/addrbook/content/.eslintrc.js
mail/components/compose/content/.eslintrc.js
mail/components/extensions/.eslintrc.js
mail/components/extensions/child/.eslintrc.js
mail/components/extensions/parent/.eslintrc.js
mail/components/extensions/test/xpcshell/.eslintrc.js
mail/components/im/content/.eslintrc.js
mail/components/preferences/.eslintrc.js
mail/components/test/unit/.eslintrc.js
mailnews/.eslintrc.js
mailnews/extensions/newsblog/.eslintrc.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   "root": true,
 
   // We would like the same base rules as provided by
   // mozilla/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
   "extends": [
     "plugin:mozilla/recommended",
@@ -39,10 +38,15 @@ module.exports = {
 
   "overrides": [{
     // eslint-plugin-html handles eol-last slightly different - it applies to
     // each set of script tags, so we turn it off here.
     "files": "**/*.*html",
     "rules": {
       "eol-last": "off",
     },
+  }, {
+    "files": "**/.eslintrc.js",
+    "env": {
+      "node": true,
+    },
   }],
 };
--- a/calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
+++ b/calendar/test/mozmill/shared-modules/test-item-editing-helpers.js
@@ -499,17 +499,17 @@ function handleAddingAttachment(controll
 
     wait_for_modal_dialog("commonDialog", TIMEOUT_MODAL_DIALOG);
 }
 
 function addAttendees(dialog, innerFrame, attendeesString) {
     let { eid: dlgid } = helpersForController(dialog);
 
     let attendees = attendeesString.split(",");
-    for (var attendee of attendees) {
+    for (let attendee of attendees) {
         let calAttendee = innerFrame.window.attendees.find(
             aAtt => aAtt.id == `mailto:${attendee}`
         );
         // Only add if not already present.
         if (!calAttendee) {
             plan_for_modal_dialog("Calendar:EventDialog:Attendees", (attDialog) => {
                 let { lookup: attlookup, sleep: attsleep } = helpersForController(attDialog);
 
@@ -533,17 +533,17 @@ function addAttendees(dialog, innerFrame
     }
 }
 
 function deleteAttendees(event, innerFrame, attendeesString) {
     let { iframeLookup } = helpersForEditUI(innerFrame);
 
     // Now delete the attendees.
     let attendees = attendeesString.split(",");
-    for (var attendee of attendees) {
+    for (let attendee of attendees) {
         let attendeeToDelete = iframeLookup(`${ATTENDEES_ROW}/{"attendeeid":"mailto:${attendee}"}`);
         // Unfortunately the context menu of the attendees is not working in
         // Mozmill tests. Thus we have to use the JS-functions.
         let calAttendee = innerFrame.window.attendees.find(aAtt => aAtt.id == `mailto:${attendee}`);
         if (calAttendee) {
             innerFrame.window.removeAttendee(calAttendee);
         }
         event.waitForElementNotPresent(attendeeToDelete);
--- a/mail/base/test/unit/.eslintrc.js
+++ b/mail/base/test/unit/.eslintrc.js
@@ -1,8 +1,7 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test",
   ],
 };
--- a/mail/components/accountcreation/content/.eslintrc.js
+++ b/mail/components/accountcreation/content/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     "Abortable": true,
     "AccountConfig": true,
     "BadCertHandler": true,
     "CancelledException": true,
     "Exception": true,
     "FetchHTTP": true,
     "Log4Moz": true,
--- a/mail/components/addrbook/content/.eslintrc.js
+++ b/mail/components/addrbook/content/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     // abCommon.js
     "AbEditCard": true,
     "AbNewMessage": true,
     "ChangeDirectoryByURI": true,
     "DirPaneController": true,
     "GenerateAddressFromCard": true,
     "GetDirectoryFromURI": true,
--- a/mail/components/compose/content/.eslintrc.js
+++ b/mail/components/compose/content/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   globals: {
     // editor/ui/composer/content/ComposerCommands.js
     doStatefulCommand: true,
     SaveDocument: true,
     // editor/ui/composer/content/editor.js
     EditorCleanup: true,
--- a/mail/components/extensions/.eslintrc.js
+++ b/mail/components/extensions/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   "globals": {
     // These are defined in the WebExtension script scopes by ExtensionCommon.jsm.
     // From toolkit/components/extensions/.eslintrc.js.
     "Cc": true,
     "Ci": true,
     "Cr": true,
--- a/mail/components/extensions/child/.eslintrc.js
+++ b/mail/components/extensions/child/.eslintrc.js
@@ -1,8 +1,8 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     // From toolkit/components/extensions/child/.eslintrc.js.
     "EventManager": true,
   },
 };
--- a/mail/components/extensions/parent/.eslintrc.js
+++ b/mail/components/extensions/parent/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   "globals": {
     // From toolkit/components/extensions/parent/.eslintrc.js.
     "CONTAINER_STORE": true,
     "DEFAULT_STORE": true,
     "EventEmitter": true,
     "EventManager": true,
--- a/mail/components/extensions/test/xpcshell/.eslintrc.js
+++ b/mail/components/extensions/test/xpcshell/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   "extends": "plugin:mozilla/xpcshell-test",
 
   "env": {
     // The tests in this folder are testing based on WebExtensions, so lets
     // just define the webextensions environment here.
     "webextensions": true,
--- a/mail/components/im/content/.eslintrc.js
+++ b/mail/components/im/content/.eslintrc.js
@@ -1,10 +1,9 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
   overrides: [{
     files: [
       "imcontact.xml",
       "imconv.xml",
       "imconversation.xml",
     ],
--- a/mail/components/preferences/.eslintrc.js
+++ b/mail/components/preferences/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     // preferences.js
     "AppConstants": true,
     "MailServices": true,
     "Services": true,
     "ExtensionSupport": true,
 
     // subdialogs.js
--- a/mail/components/test/unit/.eslintrc.js
+++ b/mail/components/test/unit/.eslintrc.js
@@ -1,8 +1,7 @@
 "use strict";
-/* eslint-env node */
 
 module.exports = {
     "extends": [
         "plugin:mozilla/xpcshell-test",
     ],
 };
--- a/mailnews/.eslintrc.js
+++ b/mailnews/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     "Log4Moz": true,
     "MailServices": true,
     "MsgHdrToMimeMessage": true,
     "ReloadMessage": true,
     "Services": true,
     "gDBView": true,
     "getBrowser": true,
--- a/mailnews/extensions/newsblog/.eslintrc.js
+++ b/mailnews/extensions/newsblog/.eslintrc.js
@@ -1,11 +1,11 @@
 "use strict";
 
-module.exports = { // eslint-disable-line no-undef
+module.exports = {
   "globals": {
     "Feed": true,
     "FeedEnclosure": true,
     "FeedItem": true,
     "FeedParser": true,
     "FeedUtils": true,
     "GetNumSelectedMessages": true,
     "gMessageNotificationBar": true,