diff --git a/.eslintrc-rollouts.js b/.eslintrc-rollouts.js index 68460242d191..62aa6219a2c3 100644 --- a/.eslintrc-rollouts.js +++ b/.eslintrc-rollouts.js @@ -2030,6 +2030,7 @@ const rollouts = [ }, }, { + // TODO: Bug TBD - Finish enabling no-shadow for all files. files: [ "browser/components/extensions/**", "docshell/test/**", diff --git a/.eslintrc.js b/.eslintrc.js index 0d3fdc7dd64e..38464c818656 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -297,9 +297,6 @@ module.exports = { "mozilla/reject-importGlobalProperties": ["error", "everything"], "mozilla/reject-mixing-eager-and-lazy": "error", "mozilla/reject-top-level-await": "error", - // TODO: Bug 1575506 turn `builtinGlobals` on here. - // We can enable builtinGlobals for jsms due to their scopes. - "no-redeclare": ["error", { builtinGlobals: false }], // Modules and workers are far easier to check for no-unused-vars on a // global scope, than our content files. Hence we turn that on here. "no-unused-vars": [ diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.worker.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.worker.js index 443b392f266a..3b17457370e4 100644 --- a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.worker.js +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.worker.js @@ -6,6 +6,7 @@ "use strict"; // Send a message to all controlled windows. +/* eslint-disable-next-line no-redeclare */ function postMessage(message) { return clients.matchAll().then(function (clientlist) { clientlist.forEach(function (client) { diff --git a/devtools/client/debugger/src/.eslintrc.js b/devtools/client/debugger/src/.eslintrc.js index ca439cd5130e..74e414c194c9 100644 --- a/devtools/client/debugger/src/.eslintrc.js +++ b/devtools/client/debugger/src/.eslintrc.js @@ -206,8 +206,6 @@ module.exports = { "no-process-exit": 0, // Disallow usage of __proto__ property. "no-proto": 2, - // Disallow declaring the same variable more than once (we use let anyway). - "no-redeclare": 2, // Disallow multiple spaces in a regular expression literal. "no-regex-spaces": 2, // Don't restrict usage of specified node modules (not a node environment). diff --git a/devtools/shared/loader/worker-loader.sys.mjs b/devtools/shared/loader/worker-loader.sys.mjs index ea2e059a0e87..0716aae13e38 100644 --- a/devtools/shared/loader/worker-loader.sys.mjs +++ b/devtools/shared/loader/worker-loader.sys.mjs @@ -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 DebuggerNotificationObserver */ - // This module does import many attributes from the global object /* eslint-disable mozilla/reject-global-this */ diff --git a/devtools/shared/worker/worker.sys.mjs b/devtools/shared/worker/worker.sys.mjs index bb1eb76095ce..ef03d2f54d7d 100644 --- a/devtools/shared/worker/worker.sys.mjs +++ b/devtools/shared/worker/worker.sys.mjs @@ -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 ChromeWorker */ - let MESSAGE_COUNTER = 0; function dumpn(_msg) { diff --git a/package-lock.json b/package-lock.json index b272f5184217..7949a30f886a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6168,7 +6168,7 @@ "license": "MPL-2.0" }, "tools/lint/eslint/eslint-plugin-mozilla": { - "version": "3.7.5", + "version": "3.7.6", "dev": true, "license": "MPL-2.0", "dependencies": { diff --git a/services/sync/modules/resource.sys.mjs b/services/sync/modules/resource.sys.mjs index 537ffd521998..737ef041a6c8 100644 --- a/services/sync/modules/resource.sys.mjs +++ b/services/sync/modules/resource.sys.mjs @@ -11,8 +11,6 @@ import { CommonUtils } from "resource://services-common/utils.sys.mjs"; import { Utils } from "resource://services-sync/util.sys.mjs"; import { setTimeout, clearTimeout } from "resource://gre/modules/Timer.sys.mjs"; -/* global AbortController */ - /* * Resource represents a remote network resource, identified by a URI. * Create an instance like so: diff --git a/toolkit/components/utils/SimpleServices.sys.mjs b/toolkit/components/utils/SimpleServices.sys.mjs index 5280d381fe87..943b1e02c80c 100644 --- a/toolkit/components/utils/SimpleServices.sys.mjs +++ b/toolkit/components/utils/SimpleServices.sys.mjs @@ -10,8 +10,6 @@ * eagerly loaded at startup. */ -/* globals WebExtensionPolicy */ - import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; const lazy = {}; diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index 1435b0b45ff1..56f760b835bf 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -63,14 +63,14 @@ module.exports = { "mozilla/reject-importGlobalProperties": ["error", "everything"], "mozilla/reject-mixing-eager-and-lazy": "error", "mozilla/reject-top-level-await": "error", - // TODO: Bug 1575506 turn `builtinGlobals` on here. - // We can enable builtinGlobals for mjs files due to their scopes. - "no-redeclare": ["error", { builtinGlobals: false }], }, }, { files: ["**/*.mjs", "**/*.jsx", "**/?(*.)worker.?(m)js"], rules: { + // We enable builtinGlobals for modules and workers due to their + // contained scopes. + "no-redeclare": ["error", { builtinGlobals: true }], "no-shadow": ["error", { allow: ["event"], builtinGlobals: true }], // Modules and workers are far easier to check for no-unused-vars on a // global scope, than our content files. Hence we turn that on here. diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index 209d4c8b2be0..7191ca332d16 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "3.7.5", + "version": "3.7.6", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index 7a73cd253b93..07fa90d0cf6f 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": "3.7.5", + "version": "3.7.6", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint",