diff --git a/browser/.eslintrc.js b/browser/.eslintrc.js index 6f0bffef89c9..f794a69567c5 100644 --- a/browser/.eslintrc.js +++ b/browser/.eslintrc.js @@ -7,6 +7,6 @@ module.exports = { "rules": { "no-shadow": "error", - "no-undef": "error" + "no-undef": "off" } }; diff --git a/browser/base/.eslintrc.js b/browser/base/.eslintrc.js index d4b366151b97..978d7b372998 100644 --- a/browser/base/.eslintrc.js +++ b/browser/base/.eslintrc.js @@ -1,7 +1,4 @@ "use strict"; module.exports = { - rules: { - "no-undef": "off" - } }; diff --git a/browser/components/.eslintrc.js b/browser/components/.eslintrc.js deleted file mode 100644 index d4b366151b97..000000000000 --- a/browser/components/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - rules: { - "no-undef": "off" - } -}; diff --git a/browser/extensions/pocket/content/main.js b/browser/extensions/pocket/content/main.js index d07e6d2992b2..25e7c54f36b6 100644 --- a/browser/extensions/pocket/content/main.js +++ b/browser/extensions/pocket/content/main.js @@ -42,7 +42,6 @@ // TODO : [nice to have] - Immediately save, buffer the actions in a local queue and send (so it works offline, works like our native extensions) /* eslint-disable no-shadow */ -/* eslint "mozilla/import-browserjs-globals": "error" */ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", diff --git a/browser/extensions/presentation/bootstrap.js b/browser/extensions/presentation/bootstrap.js index 68a7f5bd4b35..d81e3643adaa 100644 --- a/browser/extensions/presentation/bootstrap.js +++ b/browser/extensions/presentation/bootstrap.js @@ -58,8 +58,7 @@ var Presentation = { init() { log("init"); // Register PresentationDevicePrompt into a XPCOM component. - let {PresentationDevicePrompt} = Cu.import(PRESENTATION_DEVICE_PROMPT_PATH, {}); - this.PresentationDevicePrompt = PresentationDevicePrompt; + Cu.import(PRESENTATION_DEVICE_PROMPT_PATH); this._register(); }, @@ -67,7 +66,6 @@ var Presentation = { log("uninit"); // Unregister PresentationDevicePrompt XPCOM component. this._unregister(); - delete this.PresentationDevicePrompt; Cu.unload(PRESENTATION_DEVICE_PROMPT_PATH); }, @@ -75,7 +73,7 @@ var Presentation = { _register() { log("_register"); this._devicePromptFactory = new Factory(); - this._devicePromptFactory.register(this.PresentationDevicePrompt); + this._devicePromptFactory.register(PresentationDevicePrompt); }, _unregister() { diff --git a/browser/extensions/shield-recipe-client/lib/CleanupManager.jsm b/browser/extensions/shield-recipe-client/lib/CleanupManager.jsm index a25ee45ec17f..2e5f2867f374 100644 --- a/browser/extensions/shield-recipe-client/lib/CleanupManager.jsm +++ b/browser/extensions/shield-recipe-client/lib/CleanupManager.jsm @@ -4,8 +4,6 @@ "use strict"; -const {utils: Cu} = Components; - this.EXPORTED_SYMBOLS = ["CleanupManager"]; const cleanupHandlers = new Set(); diff --git a/browser/extensions/webcompat-reporter/bootstrap.js b/browser/extensions/webcompat-reporter/bootstrap.js index e7015b67ccba..51006c8d451f 100644 --- a/browser/extensions/webcompat-reporter/bootstrap.js +++ b/browser/extensions/webcompat-reporter/bootstrap.js @@ -2,8 +2,6 @@ * 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/. */ -/* global APP_SHUTDOWN:false */ - let { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/Services.jsm"); diff --git a/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm b/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm index d722267a87ea..ce68fdd191ae 100644 --- a/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm +++ b/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm @@ -31,8 +31,7 @@ let WebCompatReporter = { }, init() { - let TabListener = Cu.import(TABLISTENER_JSM, {}); - this.TabListener = TabListener; + Cu.import(TABLISTENER_JSM); let styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"] .getService(Ci.nsIStyleSheetService); @@ -62,7 +61,7 @@ let WebCompatReporter = { .getInterface(Ci.nsIDOMWindowUtils) .addSheet(this._cachedSheet, this._sheetType); // Attach listeners to new window. - win._webcompatReporterTabListener = new this.TabListener(win); + win._webcompatReporterTabListener = new TabListener(win); }, onWindowClosed(win) { @@ -84,7 +83,6 @@ let WebCompatReporter = { } CustomizableUI.removeListener(this); - delete this.TabListener; Cu.unload(TABLISTENER_JSM); }, diff --git a/browser/extensions/webcompat-reporter/content/tab-frame.js b/browser/extensions/webcompat-reporter/content/tab-frame.js index f94ddfc4f72d..3ec978775eb6 100644 --- a/browser/extensions/webcompat-reporter/content/tab-frame.js +++ b/browser/extensions/webcompat-reporter/content/tab-frame.js @@ -2,8 +2,6 @@ * 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/. */ -/* global content:false, sendAsyncMessage:false */ - let { utils: Cu } = Components; const TABDATA_MESSAGE = "WebCompat:SendTabData"; diff --git a/browser/extensions/webcompat-reporter/content/wc-frame.js b/browser/extensions/webcompat-reporter/content/wc-frame.js index c1c047b53804..f37f344d5780 100644 --- a/browser/extensions/webcompat-reporter/content/wc-frame.js +++ b/browser/extensions/webcompat-reporter/content/wc-frame.js @@ -2,8 +2,6 @@ * 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/. */ -/* global content:false, addMessageListener:false, removeMessageListener: false */ - let { utils: Cu } = Components; const SCREENSHOT_MESSAGE = "WebCompat:SendScreenshot"; diff --git a/browser/extensions/webcompat/test/.eslintrc.js b/browser/extensions/webcompat/test/.eslintrc.js deleted file mode 100644 index c764b133dc9c..000000000000 --- a/browser/extensions/webcompat/test/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "../../../../testing/mochitest/browser.eslintrc.js" - ] -}; diff --git a/browser/modules/test/browser_NetworkPrioritizer.js b/browser/modules/test/browser_NetworkPrioritizer.js index c88e06545f62..a70961561aee 100644 --- a/browser/modules/test/browser_NetworkPrioritizer.js +++ b/browser/modules/test/browser_NetworkPrioritizer.js @@ -19,12 +19,11 @@ function* getPriority(aBrowser) { aBrowser = aBrowser.linkedBrowser; return yield ContentTask.spawn(aBrowser, null, function* () { - return content.document.docShell - .QueryInterface(Components.interfaces.nsIWebNavigation) - .QueryInterface(Components.interfaces.nsIDocumentLoader) - .loadGroup - .QueryInterface(Components.interfaces.nsISupportsPriority) - .priority; + return docShell.QueryInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsIDocumentLoader) + .loadGroup + .QueryInterface(Components.interfaces.nsISupportsPriority) + .priority; }); } @@ -33,12 +32,11 @@ function* setPriority(aBrowser, aPriority) { aBrowser = aBrowser.linkedBrowser; yield ContentTask.spawn(aBrowser, aPriority, function* (contentPriority) { - content.document.docShell - .QueryInterface(Components.interfaces.nsIWebNavigation) - .QueryInterface(Components.interfaces.nsIDocumentLoader) - .loadGroup - .QueryInterface(Ci.nsISupportsPriority) - .priority = contentPriority; + docShell.QueryInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsIDocumentLoader) + .loadGroup + .QueryInterface(Ci.nsISupportsPriority) + .priority = contentPriority; }); } diff --git a/browser/modules/test/contentSearch.js b/browser/modules/test/contentSearch.js index 9bf641647f1e..1dd5d846dfed 100644 --- a/browser/modules/test/contentSearch.js +++ b/browser/modules/test/contentSearch.js @@ -2,8 +2,6 @@ * 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/. */ -/* global addMessageListener:false, sendAsyncMessage:false, XPCOMUtils */ - const TEST_MSG = "ContentSearchTest"; const SERVICE_EVENT_TYPE = "ContentSearchService"; const CLIENT_EVENT_TYPE = "ContentSearchClient"; @@ -40,8 +38,8 @@ addMessageListener(TEST_MSG, msg => { function waitForLoadAndStopIt(expectedURL, callback) { let Ci = Components.interfaces; - let webProgress = content.document.docShell.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebProgress); + let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebProgress); let listener = { onStateChange(webProg, req, flags, status) { if (req instanceof Ci.nsIChannel) { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js index ff6c1362dbbb..4650e92b1f7d 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js @@ -54,16 +54,13 @@ const SCRIPTS = [ module.exports = function(context) { return { Program: function(node) { - let filepath = helpers.getAbsoluteFilePath(context); - let root = helpers.getRootDir(filepath); - let relativepath = path.relative(root, filepath); - - if ((helpers.getTestType(this) != "browser" && - !helpers.getIsHeadFile(this)) && - !relativepath.includes("content")) { + if (helpers.getTestType(this) != "browser" && + !helpers.getIsHeadFile(this)) { return; } + let filepath = helpers.getAbsoluteFilePath(context); + let root = helpers.getRootDir(filepath); for (let script of SCRIPTS) { let fileName = path.join(root, script); try { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index 42cd7c37e60c..92df733fab58 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "0.2.18", + "version": "0.2.17", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint",