From 2f8c17920f9ba010b2bc39d213cffbd489f6b845 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 4 May 2023 17:21:02 +0000 Subject: [PATCH] Bug 1830265 - Enable Prettier and ESLint on toolkit/components/backgroundtasks/defaults. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D176634 --- .eslintignore | 3 --- .prettierignore | 6 ------ .../backgroundtasks/defaults/backgroundtasks.js | 2 ++ .../defaults/backgroundtasks_browser.js | 17 ++++++++++++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.eslintignore b/.eslintignore index 37c1e5280539..116d17364def 100644 --- a/.eslintignore +++ b/.eslintignore @@ -240,9 +240,6 @@ tools/tryselect/selectors/chooser/templates/chooser.html # Ignore preprocessed *(P)refs.js files in update-packaging. tools/update-packaging/**/*refs.js -# Ignore backgroundtasks preferences files. -toolkit/components/backgroundtasks/defaults - # Ignore pre-generated webpack and typescript transpiled files for translations browser/extensions/translations/extension/ diff --git a/.prettierignore b/.prettierignore index ed10501eaf3e..cc30adc2aaa6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -64,9 +64,6 @@ devtools/shared/plural-form.js parser/htmlparser/tests/mochitest/broken_xml.xhtml parser/htmlparser/tests/mochitest/test_bug563322.xhtml -# Ignore backgroundtasks preferences files. -toolkit/components/backgroundtasks/defaults - # A mainly-imported file, that we don't want to format, but want to keep an eye # on with the other imported files. toolkit/components/formautofill/shared/CreditCardRuleset.sys.mjs @@ -304,9 +301,6 @@ tools/tryselect/selectors/chooser/templates/chooser.html # Ignore preprocessed *(P)refs.js files in update-packaging. tools/update-packaging/**/*refs.js -# Ignore backgroundtasks preferences files. -toolkit/components/backgroundtasks/defaults - # Ignore pre-generated webpack and typescript transpiled files for translations browser/extensions/translations/extension/ diff --git a/toolkit/components/backgroundtasks/defaults/backgroundtasks.js b/toolkit/components/backgroundtasks/defaults/backgroundtasks.js index 297cdce5b961..e382f1d63c8d 100644 --- a/toolkit/components/backgroundtasks/defaults/backgroundtasks.js +++ b/toolkit/components/backgroundtasks/defaults/backgroundtasks.js @@ -6,6 +6,8 @@ // `backgroundtasks_browser.js` to override browser/-specific preferences in // `firefox.js`. +/* global pref */ + pref("browser.dom.window.dump.enabled", true); pref("devtools.console.stdout.chrome", true); diff --git a/toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js b/toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js index 32a640636a3f..fbb8b3482701 100644 --- a/toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js +++ b/toolkit/components/backgroundtasks/defaults/backgroundtasks_browser.js @@ -6,6 +6,8 @@ // `firefox.js`. Use `backgroundtasks.js` to override general Gecko preferences // in `greprefs.js`. +/* global pref */ + // XUL notifications make no sense in background tasks. This is only applies to // Windows for now. pref("alerts.useSystemBackend", true); @@ -14,21 +16,30 @@ pref("alerts.useSystemBackend.windows.notificationserver.enabled", true); // Configure Messaging Experiments for background tasks, with // background task-specific feature ID. The regular Firefox Desktop // Remote Settings collection will be used. -pref("browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments", "{\"id\":\"messaging-experiments\",\"enabled\":true,\"type\":\"remote-experiments\",\"featureIds\":[\"backgroundTaskMessage\"],\"updateCycleInMs\":3600000}"); +pref( + "browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments", + '{"id":"messaging-experiments","enabled":true,"type":"remote-experiments","featureIds":["backgroundTaskMessage"],"updateCycleInMs":3600000}' +); // Disable all other Messaging System providers save for // `browser.newtabpage.activity-stream.asrouter.providers.message-groups`, which // is required for the system to function. pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", "null"); pref("browser.newtabpage.activity-stream.asrouter.providers.snippets", "null"); -pref("browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel", "null"); +pref( + "browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel", + "null" +); // The `browser.newtabpage.activity-stream.asrouter.providers.cfr` provider is // disabled, but belt and braces: disable extension recommendations and feature // recommendations. Neither of these make sense in background tasks, and they // could trigger telemetry. pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); -pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); +pref( + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", + false +); // Don't refresh experiments while a background task is running. pref("app.normandy.run_interval_seconds", 0);