diff --git a/.eslintrc.js b/.eslintrc.js index 995a2241e31e..fd628285afc9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -62,7 +62,7 @@ module.exports = { "no-unused-vars": ["error", { "args": "none", "vars": "local", - "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS" + "varsIgnorePattern": "^EXPORTED_SYMBOLS$" }] } }, { diff --git a/browser/base/content/test/static/browser_misused_characters_in_strings.js b/browser/base/content/test/static/browser_misused_characters_in_strings.js index b2d09a495946..dd804d0d1a6c 100644 --- a/browser/base/content/test/static/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js @@ -203,7 +203,7 @@ async function getAllTheFiles(extension) { } let urisGreD = await generateURIsFromDirTree(appDirGreD, [extension]); let urisXCurProcD = await generateURIsFromDirTree(appDirXCurProcD, [extension]); - return Array.from(new Set(urisGreD.concat(appDirXCurProcD))); + return Array.from(new Set(urisGreD.concat(urisXCurProcD))); } add_task(async function checkAllTheProperties() { diff --git a/browser/components/migration/.eslintrc.js b/browser/components/migration/.eslintrc.js index 7dfa6ad0e5fa..43c4be8098bc 100644 --- a/browser/components/migration/.eslintrc.js +++ b/browser/components/migration/.eslintrc.js @@ -15,7 +15,7 @@ module.exports = { "no-sequences": "error", "no-shadow": "error", "no-throw-literal": "error", - "no-unused-vars": ["error", { "varsIgnorePattern": "^EXPORTED_SYMBOLS$" }], + "no-unused-vars": ["error", { "args": "after-used", "varsIgnorePattern": "^EXPORTED_SYMBOLS$", "vars": "all" }], "padded-blocks": ["error", "never"], "semi-spacing": ["error", {"before": false, "after": true}], "space-in-parens": ["error", "never"], diff --git a/browser/experiments/.eslintrc.js b/browser/experiments/.eslintrc.js index 1f6b11d6725f..6542d5f3ce4b 100644 --- a/browser/experiments/.eslintrc.js +++ b/browser/experiments/.eslintrc.js @@ -3,9 +3,9 @@ module.exports = { "rules": { "no-unused-vars": ["error", { + "args": "none", "vars": "all", - "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", - "args": "none" + "varsIgnorePattern": "^EXPORTED_SYMBOLS$", }] } }; diff --git a/browser/extensions/formautofill/.eslintrc.js b/browser/extensions/formautofill/.eslintrc.js index c11e0db0cd61..be5f290b15a0 100644 --- a/browser/extensions/formautofill/.eslintrc.js +++ b/browser/extensions/formautofill/.eslintrc.js @@ -44,7 +44,9 @@ module.exports = { "no-unused-expressions": "error", // No declaring variables that are never used - "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}], + "no-unused-vars": ["error", { + "args": "none", "vars": "all", "varsIgnorePattern": "^EXPORTED_SYMBOLS$" + }], // No using variables before defined "no-use-before-define": "error", diff --git a/browser/tools/mozscreenshots/.eslintrc.js b/browser/tools/mozscreenshots/.eslintrc.js index d88624afeedf..abe85e32898d 100644 --- a/browser/tools/mozscreenshots/.eslintrc.js +++ b/browser/tools/mozscreenshots/.eslintrc.js @@ -7,9 +7,9 @@ module.exports = { "rules": { "no-unused-vars": ["error", { + "args": "none", "vars": "all", - "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", - "args": "none" + "varsIgnorePattern": "^EXPORTED_SYMBOLS$", }] } }; diff --git a/devtools/.eslintrc.js b/devtools/.eslintrc.js index 18339eca8153..6b19c719b6fe 100644 --- a/devtools/.eslintrc.js +++ b/devtools/.eslintrc.js @@ -215,7 +215,7 @@ module.exports = { "no-undefined": "off", // Disallow global and local variables that aren't used, but allow unused // function arguments. - "no-unused-vars": ["error", {"vars": "all", "args": "none"}], + "no-unused-vars": ["error", {"args": "none", "vars": "all"}], // Allow using variables before they are defined. "no-use-before-define": "off", // We use var-only-at-top-level instead of no-var as we allow top level diff --git a/dom/indexedDB/test/unit/xpcshell-head-child-process.js b/dom/indexedDB/test/unit/xpcshell-head-child-process.js index c4e69c3d2efe..ea13fb011fa0 100644 --- a/dom/indexedDB/test/unit/xpcshell-head-child-process.js +++ b/dom/indexedDB/test/unit/xpcshell-head-child-process.js @@ -4,8 +4,6 @@ */ function run_test() { - const { "classes": Cc, "interfaces": Ci, "utils": Cu } = Components; - ChromeUtils.import("resource://gre/modules/Services.jsm"); const INDEXEDDB_HEAD_FILE = "xpcshell-head-parent-process.js"; diff --git a/mobile/android/modules/FxAccountsWebChannel.jsm b/mobile/android/modules/FxAccountsWebChannel.jsm index 2666e6a22527..86f0588e4a47 100644 --- a/mobile/android/modules/FxAccountsWebChannel.jsm +++ b/mobile/android/modules/FxAccountsWebChannel.jsm @@ -12,12 +12,10 @@ */ var EXPORTED_SYMBOLS = ["EnsureFxAccountsWebChannel"]; -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; /* global Components */ - -ChromeUtils.import("resource://gre/modules/Accounts.jsm"); /* global Accounts */ -ChromeUtils.import("resource://gre/modules/Services.jsm"); /* global Services */ -ChromeUtils.import("resource://gre/modules/WebChannel.jsm"); /* global WebChannel */ -ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); /* global XPCOMUtils */ +ChromeUtils.import("resource://gre/modules/Accounts.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/WebChannel.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const log = ChromeUtils.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("FxAccounts"); @@ -34,7 +32,7 @@ const COMMAND_SYNC_PREFERENCES = "fxaccounts:sync_preferences"; const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash"; XPCOMUtils.defineLazyGetter(this, "strings", - () => Services.strings.createBundle("chrome://browser/locale/aboutAccounts.properties")); /* global strings */ + () => Services.strings.createBundle("chrome://browser/locale/aboutAccounts.properties")); ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm"); ChromeUtils.defineModuleGetter(this, "Prompt", "resource://gre/modules/Prompt.jsm"); diff --git a/services/sync/tps/extensions/tps/resource/tps.jsm b/services/sync/tps/extensions/tps/resource/tps.jsm index 1c108e4727da..2c6751c4afb7 100644 --- a/services/sync/tps/extensions/tps/resource/tps.jsm +++ b/services/sync/tps/extensions/tps/resource/tps.jsm @@ -8,7 +8,7 @@ */ var EXPORTED_SYMBOLS = [ - "ACTIONS", "Addons", "Addresses", "Bookmarks", + "ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards", "Formdata", "History", "Passwords", "Prefs", "Tabs", "TPS", "Windows" ]; diff --git a/toolkit/components/extensions/.eslintrc.js b/toolkit/components/extensions/.eslintrc.js index 2ebcf8597293..54668e36ae87 100644 --- a/toolkit/components/extensions/.eslintrc.js +++ b/toolkit/components/extensions/.eslintrc.js @@ -92,7 +92,9 @@ module.exports = { "no-unused-expressions": "error", // No declaring variables that are never used - "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}], + "no-unused-vars": ["error", { + "args": "none", "vars": "all", "varsIgnorePattern": "^EXPORTED_SYMBOLS$" + }], // No using variables before defined "no-use-before-define": "error", diff --git a/toolkit/components/extensions/test/mochitest/chrome_head.js b/toolkit/components/extensions/test/mochitest/chrome_head.js index 6783c9c77852..466ad224f138 100644 --- a/toolkit/components/extensions/test/mochitest/chrome_head.js +++ b/toolkit/components/extensions/test/mochitest/chrome_head.js @@ -1,12 +1,4 @@ "use strict"; -const { - classes: Cc, - interfaces: Ci, - utils: Cu, - results: Cr, -} = Components; - ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); - diff --git a/toolkit/components/narrate/.eslintrc.js b/toolkit/components/narrate/.eslintrc.js index f088686d5728..38d8a6b4ad02 100644 --- a/toolkit/components/narrate/.eslintrc.js +++ b/toolkit/components/narrate/.eslintrc.js @@ -27,7 +27,6 @@ module.exports = { "no-sequences": "error", "no-shadow": "error", "no-throw-literal": "error", - "no-unused-vars": "error", "padded-blocks": ["error", "never"], "quotes": ["error", "double", "avoid-escape"], "semi-spacing": ["error", {"before": false, "after": true}], diff --git a/toolkit/components/payments/.eslintrc.js b/toolkit/components/payments/.eslintrc.js index 8fc30896885d..46ccda07b9c7 100644 --- a/toolkit/components/payments/.eslintrc.js +++ b/toolkit/components/payments/.eslintrc.js @@ -41,7 +41,8 @@ module.exports = { "no-unused-expressions": "error", "no-unused-vars": ["error", { args: "none", - varsIgnorePattern: "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", + vars: "all", + varsIgnorePattern: "^EXPORTED_SYMBOLS$", }], "no-use-before-define": ["error", { functions: false, diff --git a/toolkit/components/satchel/.eslintrc.js b/toolkit/components/satchel/.eslintrc.js index e765b84568a6..00fa55b432dc 100644 --- a/toolkit/components/satchel/.eslintrc.js +++ b/toolkit/components/satchel/.eslintrc.js @@ -42,7 +42,8 @@ module.exports = { "no-unused-expressions": "error", "no-unused-vars": ["error", { args: "none", - varsIgnorePattern: "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", + vars: "all", + varsIgnorePattern: "^EXPORTED_SYMBOLS$", }], "no-use-before-define": ["error", { functions: false, diff --git a/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js b/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js index 12fc623f3d1f..c07530894090 100644 --- a/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js +++ b/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js @@ -143,7 +143,6 @@ add_task(async function test_aggregation() { const SCALAR_FULL_NAME = "telemetry.cheattest.dynamic.test_aggregation"; Services.telemetry.scalarAdd(SCALAR_FULL_NAME, 1); - let processCreated = TestUtils.topicObserved(CONTENT_CREATED); await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank", forceNewProcess: true }, async function(browser) { // Accumulate from the content process into both dynamic scalars. diff --git a/toolkit/mozapps/extensions/.eslintrc.js b/toolkit/mozapps/extensions/.eslintrc.js index 5f78dccf5e58..3fdddb08985e 100644 --- a/toolkit/mozapps/extensions/.eslintrc.js +++ b/toolkit/mozapps/extensions/.eslintrc.js @@ -7,6 +7,10 @@ module.exports = { // be removed & synced with the mozilla/recommended value. "complexity": ["error", {"max": 68}], - "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}], + "no-unused-vars": ["error", { + "args": "none", + "vars": "all", + "varsIgnorePattern": "^EXPORTED_SYMBOLS$" + }], } }; 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 f4c227c34551..0e2fb3cb7422 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -78,7 +78,7 @@ module.exports = { "no-unused-vars": ["error", { "args": "none", "vars": "all", - "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS" + "varsIgnorePattern": "^EXPORTED_SYMBOLS$" }] } }], @@ -355,7 +355,7 @@ module.exports = { "no-unused-vars": ["error", { "args": "none", "vars": "local", - "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS" + "varsIgnorePattern": "^EXPORTED_SYMBOLS$" }], // No using variables before defined diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index a56344cbd625..e358edbee435 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": "0.9.0", + "version": "0.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index a18cd9472e1c..0402de217e0e 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.9.0", + "version": "0.9.1", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint", diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json index 6605d7bac1f1..faf2b2386ce2 100644 --- a/tools/lint/eslint/modules.json +++ b/tools/lint/eslint/modules.json @@ -205,7 +205,7 @@ "Timer.jsm": ["setTimeout", "setTimeoutWithTarget", "clearTimeout", "setInterval", "setIntervalWithTarget", "clearInterval"], "tokenserverclient.js": ["TokenServerClient", "TokenServerClientError", "TokenServerClientNetworkError", "TokenServerClientServerError"], "ToolboxProcess.jsm": ["BrowserToolboxProcess"], - "tps.jsm": ["ACTIONS", "TPS"], + "tps.jsm": ["ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards", "Formdata", "History", "Passwords", "Prefs", "Tabs", "TPS", "Windows"], "Translation.jsm": ["Translation", "TranslationTelemetry"], "Traversal.jsm": ["TraversalRules", "TraversalHelper"], "UpdateTelemetry.jsm": ["AUSTLMY"],