mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1440379 - Tidy up ESlint no-unused-vars definitions wrt Ci/Cu/Cr/Cc usage for varsIgnorePattern. r=florian
MozReview-Commit-ID: HmliR8iNRDq --HG-- extra : rebase_source : 483ae0b54b9e781cceac2accdfb2255d725ace6a
This commit is contained in:
parent
6e7897e220
commit
6afe18b30a
@ -62,7 +62,7 @@ module.exports = {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "local",
|
||||
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
|
||||
"varsIgnorePattern": "^EXPORTED_SYMBOLS$"
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
|
@ -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() {
|
||||
|
@ -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"],
|
||||
|
@ -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$",
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
@ -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",
|
||||
|
@ -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$",
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
@ -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");
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = [
|
||||
"ACTIONS", "Addons", "Addresses", "Bookmarks",
|
||||
"ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards",
|
||||
"Formdata", "History", "Passwords", "Prefs",
|
||||
"Tabs", "TPS", "Windows"
|
||||
];
|
||||
|
@ -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",
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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}],
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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$"
|
||||
}],
|
||||
}
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -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",
|
||||
|
@ -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"],
|
||||
|
Loading…
Reference in New Issue
Block a user