diff --git a/.eslintrc.js b/.eslintrc.js index efe54ec17eed..4e05cd777cc6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -303,6 +303,60 @@ module.exports = { "mozilla/use-console-createInstance": "off", }, }, + { + // Bug 1881270 - Gradually roll-out no-case-declarations to more areas. + files: [ + "accessible/tests/mochitest/promisified-events.js", + "browser/actors/**", + "browser/base/content/**", + "browser/components/**", + "browser/modules/BrowserUsageTelemetry.sys.mjs", + "browser/modules/URILoadingHelper.sys.mjs", + "devtools/client/**", + "devtools/server/**", + "devtools/shared/layout/dom-matrix-2d.js", + "devtools/startup/DevToolsStartup.sys.mjs", + "docshell/test/navigation/file_blockBFCache.html", + "docshell/test/navigation/test_bug1375833.html", + "docshell/test/unit/AllowJavascriptParent.sys.mjs", + "dom/base/test/chrome/window_nsITextInputProcessor.xhtml", + "dom/html/test/forms/test_input_sanitization.html", + "dom/media/PeerConnection.sys.mjs", + "dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_AudioParamStream.html", + "dom/payments/test/PayerDetailsChromeScript.js", + "dom/payments/test/simple_payment_request.html", + "dom/push/PushService.sys.mjs", + "dom/security/test/referrer-policy/browser_referrer_disallow_cross_site_relaxing.js", + "dom/tests/mochitest/bugs/test_bug622361.html", + "dom/workers/test/sourcemap_header_debugger.js", + "gfx/layers/apz/test/mochitest/**", + "intl/locale/tests/unit/test_localeService.js", + "layout/tools/layout-debug/LayoutDebugChild.sys.mjs", + "layout/tools/reftest/reftest.sys.mjs", + "mobile/android/actors/**", + "mobile/android/components/geckoview/GeckoViewStartup.sys.mjs", + "mobile/android/modules/geckoview/**", + "netwerk/test/browser/browser_test_data_channel_observer.js", + "netwerk/test/unit/test_proxyconnect.js", + "remote/**", + "services/fxaccounts/**", + "services/sync/**", + "testing/mochitest/ShutdownLeaksCollector.sys.mjs", + "testing/specialpowers/content/SpecialPowers*.sys.mjs", + "toolkit/actors/**", + "toolkit/components/**", + "toolkit/modules/**", + "toolkit/mozapps/downloads/DownloadLastDir.sys.mjs", + "toolkit/mozapps/extensions/**", + "toolkit/mozapps/update/UpdateListener.sys.mjs", + "toolkit/content/widgets/**", + "uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js", + "widget/tests/file_test_ime_state_on_focus_move.js", + ], + rules: { + "no-case-declarations": "warn", + }, + }, { // Bug 1881268 - Gradually roll-out no-constant-condition to more areas. files: [ 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 343ea510988c..2c55e472d9f3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -206,10 +206,6 @@ module.exports = { // Disallow use of arguments.caller or arguments.callee. "no-caller": "error", - // XXX Bug 1487642 - decide if we want to enable this or not. - // Disallow lexical declarations in case clauses - "no-case-declarations": "off", - // XXX Bug 1487642 - decide if we want to enable this or not. // Disallow the use of console "no-console": "off",