Bug 1508322 - Define 'importGlobalProperties' variables as explicit in ESLint to help identify unused variables. r=mossop
authorMark Banner <standard8@mozilla.com>
Mon, 19 Nov 2018 18:23:16 +0000
changeset 506239 f5d0cd55a71393bd9fe0bf3673f500aa3a9c3ddb
parent 506238 fa092e8167f2d92cf14735fe965a8c2c3b93151a
child 506240 1d500eb5982310cce77eb7af298584b150ff1d5e
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1508322
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508322 - Define 'importGlobalProperties' variables as explicit in ESLint to help identify unused variables. r=mossop Differential Revision: https://phabricator.services.mozilla.com/D12327
toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js
tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
tools/lint/eslint/eslint-plugin-mozilla/package.json
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
@@ -1,14 +1,12 @@
 "use strict";
 
 const {ExtensionManager} = ChromeUtils.import("resource://gre/modules/ExtensionChild.jsm", {});
 
-Cu.importGlobalProperties(["Blob", "URL"]);
-
 let experimentAPIs = {
   userinputtest: {
     schema: "schema.json",
     parent: {
       scopes: ["addon_parent"],
       script: "parent.js",
       paths: [["userinputtest"]],
     },
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
@@ -2,18 +2,16 @@
 
 /* eslint-disable mozilla/no-arbitrary-setTimeout */
 /* eslint-disable no-shadow */
 
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm");
 ChromeUtils.import("resource://testing-common/ExtensionTestCommon.jsm");
 
-Cu.importGlobalProperties(["URL"]);
-
 const HOSTS = new Set([
   "example.com",
 ]);
 
 const server = createHttpServer({hosts: HOSTS});
 
 const BASE_URL = "http://example.com";
 const FETCH_ORIGIN = "http://example.com/data/file_sample.html";
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js
@@ -263,16 +263,17 @@ module.exports = {
         express.callee.object &&
         express.callee.object.type === "Identifier" &&
         express.arguments.length === 1 &&
         express.arguments[0].type === "ArrayExpression" &&
         express.callee.property.type === "Identifier" &&
         express.callee.property.name === "importGlobalProperties") {
       return express.arguments[0].elements.map(literal => {
         return {
+          explicit: true,
           name: literal.value,
           writable: false,
         };
       });
     }
 
     let source;
     try {
--- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
+++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
@@ -1,11 +1,11 @@
 {
   "name": "eslint-plugin-mozilla",
-  "version": "0.16.2",
+  "version": "0.16.3",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
     "acorn": {
       "version": "5.7.1",
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz",
       "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==",
       "dev": true
--- a/tools/lint/eslint/eslint-plugin-mozilla/package.json
+++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json
@@ -1,11 +1,11 @@
 {
   "name": "eslint-plugin-mozilla",
-  "version": "0.16.2",
+  "version": "0.16.3",
   "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
   "keywords": [
     "eslint",
     "eslintplugin",
     "eslint-plugin",
     "mozilla",
     "firefox"
   ],