From 2d03564d1ed9f14f20ecddc74f38ca663d0033e3 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 4 May 2023 17:21:03 +0000 Subject: [PATCH] Bug 1830265 - Tidy up .prettierignore. r=Gijs,sync-reviewers,markh Enables Prettier for (these don't need to be excluded): - extensions/pref/autoconfig/test/unit/autoconfig.js - services/sync/tests/unit/prefs_test_prefs_store.js Removes duplications where the files are already ignored in the .eslintignore section. Re-organises the structure of the remaining parts to make it clearer why they are being excluded. Differential Revision: https://phabricator.services.mozilla.com/D176636 --- .eslintignore | 1 + .prettierignore | 46 ++++--------------- .../pref/autoconfig/test/unit/autoconfig.js | 1 - .../sync/tests/unit/prefs_test_prefs_store.js | 5 +- 4 files changed, 13 insertions(+), 40 deletions(-) diff --git a/.eslintignore b/.eslintignore index 116d17364def..f1d1d9555c24 100644 --- a/.eslintignore +++ b/.eslintignore @@ -90,6 +90,7 @@ devtools/client/webconsole/test/browser/test-autocomplete-mapped.src.js devtools/client/inspector/markup/test/shadowdom_open_debugger.min.js devtools/client/webconsole/test/browser/test-click-function-to-source*.js devtools/client/webconsole/test/browser/test-external-script-errors.js +devtools/client/webconsole/test/browser/test-mangled-function.* devtools/client/webconsole/test/browser/test-message-categories-canvas-css.js devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.js devtools/client/webconsole/test/browser/test-sourcemap*.js diff --git a/.prettierignore b/.prettierignore index 2c0f18ef9d91..2532f2b6af77 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,55 +14,24 @@ # This should be re-enabled in bug 1827456. js/src/builtin - # Don't format README files. README -# Ignore default pref files which have a .js suffix but aren't parsed normally as JavaScript. -browser/app/profile/channel-prefs.js -browser/app/profile/firefox.js -browser/branding/aurora/pref/firefox-branding.js -browser/branding/nightly/pref/firefox-branding.js -browser/branding/official/pref/firefox-branding.js -browser/branding/unofficial/pref/firefox-branding.js -devtools/client/preferences/debugger.js -extensions/pref/autoconfig/test/unit/autoconfig.js -mobile/android/app/geckoview-prefs.js -mobile/android/app/mobile.js -mobile/android/installer/mobile-l10n.js -modules/libpref/init/all.js -modules/libpref/test/unit/data/testParser.js -modules/libpref/test/unit/data/testPrefLocked.js -modules/libpref/test/unit/data/testPrefSticky.js -modules/libpref/test/unit/extdata/testExt.js -services/sync/tests/unit/prefs_test_prefs_store.js - # Ignore CORS fixtures which require specific resource hashes. dom/security/test/sri/script* -# Ignore other DOM fixtures with funky chars. +# Files that are intentionally broken for tests. dom/base/test/file_bug687859-charset.js dom/base/test/file_bug687859-inherit.js - -# Ignore devtools debugger files -devtools/client/debugger/src/test/examples/** -devtools/client/debugger/src/test/integration/** -devtools/client/debugger/src/test/unit-sources/** -devtools/client/debugger/src/**/fixtures/** -devtools/client/debugger/src/test/mochitest/** - -# These are source mapped and the locations are asserted in the test case. -devtools/client/webconsole/test/browser/test-mangled-function.* - -# This file is based on another and we want to keep the syntax the same. -devtools/shared/plural-form.js - -# Intentionally broken files parser/htmlparser/tests/mochitest/broken_xml.xhtml parser/htmlparser/tests/mochitest/test_bug563322.xhtml -# A mainly-imported file, that we don't want to format, but want to keep an eye -# on with the other imported files. +# Files that are specific formats/layouts for tests. +devtools/client/debugger/src/**/fixtures/** + +# Imported files where we don't want to change the format, but we do want ESLint +# to keep an eye on them (hence not in Generated.txt/ThirdPartyFiles.txt) +devtools/shared/plural-form.js toolkit/components/formautofill/shared/CreditCardRuleset.sys.mjs ############################################################################## @@ -148,6 +117,7 @@ devtools/client/webconsole/test/browser/test-autocomplete-mapped.src.js devtools/client/inspector/markup/test/shadowdom_open_debugger.min.js devtools/client/webconsole/test/browser/test-click-function-to-source*.js devtools/client/webconsole/test/browser/test-external-script-errors.js +devtools/client/webconsole/test/browser/test-mangled-function.* devtools/client/webconsole/test/browser/test-message-categories-canvas-css.js devtools/client/webconsole/test/browser/test-message-categories-empty-getelementbyid.js devtools/client/webconsole/test/browser/test-sourcemap*.js diff --git a/extensions/pref/autoconfig/test/unit/autoconfig.js b/extensions/pref/autoconfig/test/unit/autoconfig.js index 284c9c66c57e..c891c5d1088c 100644 --- a/extensions/pref/autoconfig/test/unit/autoconfig.js +++ b/extensions/pref/autoconfig/test/unit/autoconfig.js @@ -3,4 +3,3 @@ pref("general.config.sandbox_enabled", true); pref("general.config.filename", "autoconfig.cfg"); pref("general.config.vendor", "autoconfig"); pref("general.config.obscure_value", 0); - diff --git a/services/sync/tests/unit/prefs_test_prefs_store.js b/services/sync/tests/unit/prefs_test_prefs_store.js index fad4f816746b..63851a6934e2 100644 --- a/services/sync/tests/unit/prefs_test_prefs_store.js +++ b/services/sync/tests/unit/prefs_test_prefs_store.js @@ -30,7 +30,10 @@ user_pref("testing.dont.change", "Please don't change me."); user_pref("testing.turned.off", "I won't get synced."); user_pref("testing.not.turned.on", "I won't get synced either!"); // Some url we don't want to sync -user_pref("testing.unsynced.url", "moz-extension://d5d31b00-b944-4afb-bd3d-d0326551a0ae"); +user_pref( + "testing.unsynced.url", + "moz-extension://d5d31b00-b944-4afb-bd3d-d0326551a0ae" +); user_pref("testing.synced.url", "https://www.example.com"); // A pref that exists but still has the default value - will be synced with