forked from mirrors/gecko-dev
Bug 1881266 - Enable ESLint recommended rule no-case-declarations globally, warning for existing cases. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D202320
This commit is contained in:
parent
c9b5df99c1
commit
726c6acf03
2 changed files with 54 additions and 4 deletions
54
.eslintrc.js
54
.eslintrc.js
|
|
@ -303,6 +303,60 @@ module.exports = {
|
||||||
"mozilla/use-console-createInstance": "off",
|
"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.
|
// Bug 1881268 - Gradually roll-out no-constant-condition to more areas.
|
||||||
files: [
|
files: [
|
||||||
|
|
|
||||||
|
|
@ -206,10 +206,6 @@ module.exports = {
|
||||||
// Disallow use of arguments.caller or arguments.callee.
|
// Disallow use of arguments.caller or arguments.callee.
|
||||||
"no-caller": "error",
|
"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.
|
// XXX Bug 1487642 - decide if we want to enable this or not.
|
||||||
// Disallow the use of console
|
// Disallow the use of console
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue