diff --git a/.eslintrc.js b/.eslintrc.js index 96155af5b731..bd97f421ddcb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,15 +39,6 @@ module.exports = { "env": { "mozilla/browser-window": true } - }, { - // XXX Bug 1436303. These directories are still being fixed, so turn off - // mozilla/no-cc-etc for now. - "files": [ - "devtools/**" - ], - "rules": { - "mozilla/no-define-cc-etc": "off", - } }, { // XXX Bug 1452706. These directories are still being fixed, so turn off // mozilla/require-expected-throws-or-rejects for now. diff --git a/devtools/.eslintrc.js b/devtools/.eslintrc.js index 1a56593bbe14..75ad6c0e7319 100644 --- a/devtools/.eslintrc.js +++ b/devtools/.eslintrc.js @@ -149,7 +149,40 @@ module.exports = { "rules": { "no-unused-vars": ["error", {"args": "none", "vars": "local"}], } - }], + }, { + // Cu, Cc etc... are not available in most devtools modules loaded by require. + "files": [ + "**" + ], + "excludedFiles": [ + // Enable the rule on JSM, test head files and some specific files. + "**/*.jsm", + "**/test/**/head.js", + "**/test/**/shared-head.js", + "client/debugger/test/mochitest/code_frame-script.js", + "client/inspector/animation-old/test/doc_frame_script.js", + "client/inspector/animation/test/doc_frame_script.js", + "client/inspector/rules/test/doc_frame_script.js", + "client/inspector/shared/test/doc_frame_script.js", + "client/jsonview/converter-observer.js", + "client/jsonview/test/doc_frame_script.js", + "client/responsive.html/browser/content.js", + "client/shared/browser-loader.js", + "server/actors/webconsole/content-process-forward.js", + "server/actors/worker/service-worker-process.js", + "server/startup/content-process.js", + "server/startup/frame.js", + "shared/base-loader.js", + "shared/worker/loader.js", + "startup/aboutdebugging-registration.js", + "startup/aboutdevtools/aboutdevtools-registration.js", + "startup/aboutdevtoolstoolbox-registration.js", + "startup/devtools-startup.js", + ], + "rules": { + "mozilla/no-define-cc-etc": "off", + } + }, ], "rules": { // These are the rules that have been configured so far to match the // devtools coding style. diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js index c832abb0b390..abbf82936aa1 100644 --- a/devtools/client/shared/test/shared-head.js +++ b/devtools/client/shared/test/shared-head.js @@ -10,8 +10,7 @@ // devtools. // It contains various common helper functions. -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr, Constructor: CC} - = Components; +const { Constructor: CC } = Components; function scopedCuImport(path) { const scope = {}; diff --git a/devtools/shared/base-loader.js b/devtools/shared/base-loader.js index 87cf91ef6e34..ae1c005c7eb2 100644 --- a/devtools/shared/base-loader.js +++ b/devtools/shared/base-loader.js @@ -9,8 +9,7 @@ this.EXPORTED_SYMBOLS = ["Loader", "resolveURI", "Module", "Require", "unload"]; -const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu, - results: Cr, manager: Cm } = Components; +const { Constructor: CC, manager: Cm } = Components; const systemPrincipal = CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(); const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {}); diff --git a/devtools/shared/worker/loader.js b/devtools/shared/worker/loader.js index 5be682f1bdb2..45616eb2eb9a 100644 --- a/devtools/shared/worker/loader.js +++ b/devtools/shared/worker/loader.js @@ -449,12 +449,7 @@ var { } = (function() { // Main thread if (typeof Components === "object") { - const { - Constructor: CC, - classes: Cc, - interfaces: Ci, - utils: Cu - } = Components; + const { Constructor: CC } = Components; const principal = CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")();