From 77f2a394234dbabcaf4e354d58978bbe050937f0 Mon Sep 17 00:00:00 2001 From: Cristian Tuns Date: Wed, 7 Feb 2024 01:26:39 -0500 Subject: [PATCH] Backed out 11 changesets (bug 1878554, bug 1878553, bug 1878556) for causing node failures in aboutwelcome CLOSED TREE Backed out changeset 425f70fa7e5a (bug 1878556) Backed out changeset 2ab3a28f5c04 (bug 1878556) Backed out changeset fb2e02682c8c (bug 1878556) Backed out changeset 2fc5e630568e (bug 1878554) Backed out changeset 78839d5841b4 (bug 1878554) Backed out changeset e0ab31d2de1b (bug 1878554) Backed out changeset 4eb59e4ebafa (bug 1878554) Backed out changeset ab1e077d3f84 (bug 1878554) Backed out changeset ef999f293e3e (bug 1878553) Backed out changeset cf49920cb1ad (bug 1878553) Backed out changeset 95f0fce63726 (bug 1878553) --- .eslintrc.js | 13 +- browser/components/aboutwelcome/.eslintrc.js | 30 +++- .../aboutwelcome/content-src/aboutwelcome.jsx | 2 +- .../content-src/components/AddonsPicker.jsx | 2 +- .../content-src/components/HelpText.jsx | 2 +- .../content-src/components/HeroImage.jsx | 2 +- .../components/LanguageSwitcher.jsx | 2 +- .../components/MobileDownloads.jsx | 2 +- .../components/MultiStageAboutWelcome.jsx | 7 +- .../components/MultiStageProtonScreen.jsx | 2 +- .../content-src/components/ReturnToAMO.jsx | 4 +- ...elcome-utils.mjs => aboutwelcome-utils.js} | 0 .../content/aboutwelcome.bundle.js | 158 +++++++++--------- .../aboutwelcome/karma.mc.config.js | 4 +- .../unit/MultiStageAboutWelcome.test.jsx | 2 +- browser/components/asrouter/.eslintrc.js | 30 +++- .../ASRouterAdmin/ASRouterAdmin.jsx | 5 + .../asrouter/content-src/template-utils.js | 22 +++ .../templates/FirstRun/addUtmParams.js} | 0 .../asrouter/content/asrouter-admin.bundle.js | 20 ++- .../tests/unit/addUtmParams.test.js | 5 +- .../tests/unit/template-utils.test.js | 31 ++++ browser/components/newtab/.eslintrc.js | 33 ++-- .../content-src/components/Search/Search.jsx | 1 + .../data/content/activity-stream.bundle.js | 1 + .../ImpressionStats.test.jsx | 2 + .../TopSiteImpressionWrapper.test.jsx | 2 + browser/components/pocket/webpack.config.js | 1 + .../custom-elements-manifest.config.mjs | 4 +- devtools/client/debugger/babel.config.js | 2 + devtools/client/debugger/jest-test.config.js | 2 + devtools/client/debugger/jest.config.js | 2 + .../shared/sourceeditor/webpack.config.js | 1 + .../shared/test-helpers/shared-jest.config.js | 1 + .../lib/configs/recommended.js | 15 +- 35 files changed, 270 insertions(+), 142 deletions(-) rename browser/components/aboutwelcome/content-src/lib/{aboutwelcome-utils.mjs => aboutwelcome-utils.js} (100%) create mode 100644 browser/components/asrouter/content-src/template-utils.js rename browser/components/{aboutwelcome/content-src/lib/addUtmParams.mjs => asrouter/content-src/templates/FirstRun/addUtmParams.js} (100%) rename browser/components/{aboutwelcome => asrouter}/tests/unit/addUtmParams.test.js (93%) create mode 100644 browser/components/asrouter/tests/unit/template-utils.test.js diff --git a/.eslintrc.js b/.eslintrc.js index e5f7131152e6..18db9e2c340a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,15 +68,10 @@ module.exports = { plugins: ["mozilla", "import", "json"], overrides: [ { - files: [ - // All .eslintrc.js files are in the node environment, so turn that - // on here. - // https://github.com/eslint/eslint/issues/13008 - ".eslintrc.js", - // *.config.js files are generally assumed to be configuration files - // based for node. - "*.config.?(m)js", - ], + // All .eslintrc.js files are in the node environment, so turn that + // on here. + // https://github.com/eslint/eslint/issues/13008 + files: [".eslintrc.js"], env: { node: true, browser: false, diff --git a/browser/components/aboutwelcome/.eslintrc.js b/browser/components/aboutwelcome/.eslintrc.js index d5f33683e5f9..acc49cb388ee 100644 --- a/browser/components/aboutwelcome/.eslintrc.js +++ b/browser/components/aboutwelcome/.eslintrc.js @@ -4,6 +4,11 @@ module.exports = { // When adding items to this file please check for effects on sub-directories. + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, plugins: ["import", "react", "jsx-a11y"], settings: { react: { @@ -13,9 +18,8 @@ module.exports = { extends: ["plugin:jsx-a11y/recommended"], overrides: [ { - // TODO: Bug 1773467 - Move these to .mjs or figure out a generic way - // to identify these as modules. - files: ["tests/unit/**/*.js"], + // Only mark the files as modules which are actually modules. + files: ["content-src/**", "tests/unit/**"], parserOptions: { sourceType: "module", }, @@ -38,7 +42,7 @@ module.exports = { }, }, { - files: ["content-src/**", "tests/unit/**"], + files: ["./*.js", "content-src/**", "tests/unit/**"], env: { node: true, }, @@ -56,6 +60,8 @@ module.exports = { rules: { // Disallow commonjs in these directories. "import/no-commonjs": 2, + // Allow JSX with arrow functions. + "react/jsx-no-bind": 0, }, }, { @@ -76,6 +82,7 @@ module.exports = { rules: { "func-name-matching": 0, "lines-between-class-members": 0, + "require-await": 0, }, }, ], @@ -84,10 +91,7 @@ module.exports = { "react/jsx-boolean-value": ["error", "always"], "react/jsx-key": "error", - "react/jsx-no-bind": [ - "error", - { allowArrowFunctions: true, allowFunctions: true }, - ], + "react/jsx-no-bind": "error", "react/jsx-no-comment-textnodes": "error", "react/jsx-no-duplicate-props": "error", "react/jsx-no-target-blank": "error", @@ -123,15 +127,20 @@ module.exports = { "block-scoped-var": "error", "consistent-this": ["error", "use-bind"], eqeqeq: "error", + "for-direction": "error", "func-name-matching": "error", "getter-return": "error", "guard-for-in": "error", + "handle-callback-err": "error", + "lines-between-class-members": "error", "max-depth": ["error", 4], "max-nested-callbacks": ["error", 4], "max-params": ["error", 6], "max-statements": ["error", 50], + "max-statements-per-line": ["error", { max: 2 }], "new-cap": ["error", { newIsCap: true, capIsNew: false }], "no-alert": "error", + "no-buffer-constructor": "error", "no-console": ["error", { allow: ["error"] }], "no-div-regex": "error", "no-duplicate-imports": "error", @@ -141,12 +150,16 @@ module.exports = { "no-implicit-coercion": ["error", { allow: ["!!"] }], "no-implicit-globals": "error", "no-loop-func": "error", + "no-mixed-requires": "error", "no-multi-assign": "error", "no-multi-str": "error", "no-new": "error", "no-new-func": "error", + "no-new-require": "error", "no-octal-escape": "error", "no-param-reassign": "error", + "no-path-concat": "error", + "no-process-exit": "error", "no-proto": "error", "no-prototype-builtins": "error", "no-return-assign": ["error", "except-parens"], @@ -177,6 +190,7 @@ module.exports = { "prefer-spread": "error", "prefer-template": "error", radix: ["error", "always"], + "require-await": "error", "sort-vars": "error", "symbol-description": "error", "vars-on-top": "error", diff --git a/browser/components/aboutwelcome/content-src/aboutwelcome.jsx b/browser/components/aboutwelcome/content-src/aboutwelcome.jsx index 28bef5599837..fc5d951e1085 100644 --- a/browser/components/aboutwelcome/content-src/aboutwelcome.jsx +++ b/browser/components/aboutwelcome/content-src/aboutwelcome.jsx @@ -4,7 +4,7 @@ import React from "react"; import ReactDOM from "react-dom"; -import { AboutWelcomeUtils } from "./lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "./lib/aboutwelcome-utils"; import { MultiStageAboutWelcome } from "./components/MultiStageAboutWelcome"; import { ReturnToAMO } from "./components/ReturnToAMO"; diff --git a/browser/components/aboutwelcome/content-src/components/AddonsPicker.jsx b/browser/components/aboutwelcome/content-src/components/AddonsPicker.jsx index f4519eaa7a5e..3003771976b9 100644 --- a/browser/components/aboutwelcome/content-src/components/AddonsPicker.jsx +++ b/browser/components/aboutwelcome/content-src/components/AddonsPicker.jsx @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ import React from "react"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; import { Localized } from "./MSLocalized"; export const AddonsPicker = props => { diff --git a/browser/components/aboutwelcome/content-src/components/HelpText.jsx b/browser/components/aboutwelcome/content-src/components/HelpText.jsx index f7cb91df2480..10f7463f0246 100644 --- a/browser/components/aboutwelcome/content-src/components/HelpText.jsx +++ b/browser/components/aboutwelcome/content-src/components/HelpText.jsx @@ -4,7 +4,7 @@ import React from "react"; import { Localized } from "./MSLocalized"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; const MS_STRING_PROP = "string_id"; export const HelpText = props => { diff --git a/browser/components/aboutwelcome/content-src/components/HeroImage.jsx b/browser/components/aboutwelcome/content-src/components/HeroImage.jsx index 9ca89179faca..bdfd95adb722 100644 --- a/browser/components/aboutwelcome/content-src/components/HeroImage.jsx +++ b/browser/components/aboutwelcome/content-src/components/HeroImage.jsx @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ import React from "react"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; export const HeroImage = props => { const { height, url, alt } = props; diff --git a/browser/components/aboutwelcome/content-src/components/LanguageSwitcher.jsx b/browser/components/aboutwelcome/content-src/components/LanguageSwitcher.jsx index b5ebc699098a..ecaf2571b57c 100644 --- a/browser/components/aboutwelcome/content-src/components/LanguageSwitcher.jsx +++ b/browser/components/aboutwelcome/content-src/components/LanguageSwitcher.jsx @@ -4,7 +4,7 @@ import React, { useState, useEffect } from "react"; import { Localized } from "./MSLocalized"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; /** * The language switcher implements a hook that should be placed at a higher level diff --git a/browser/components/aboutwelcome/content-src/components/MobileDownloads.jsx b/browser/components/aboutwelcome/content-src/components/MobileDownloads.jsx index fbd09408059f..8fd6b9999983 100644 --- a/browser/components/aboutwelcome/content-src/components/MobileDownloads.jsx +++ b/browser/components/aboutwelcome/content-src/components/MobileDownloads.jsx @@ -4,7 +4,7 @@ import React from "react"; import { Localized } from "./MSLocalized"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; export const MarketplaceButtons = props => { return ( diff --git a/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx b/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx index d3493bea3549..4a609a8e2e65 100644 --- a/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx +++ b/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx @@ -4,11 +4,14 @@ import React, { useState, useEffect, useRef } from "react"; import { Localized } from "./MSLocalized"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; import { MultiStageProtonScreen } from "./MultiStageProtonScreen"; import { useLanguageSwitcher } from "./LanguageSwitcher"; import { SubmenuButton } from "./SubmenuButton"; -import { BASE_PARAMS, addUtmParams } from "../lib/addUtmParams.mjs"; +import { + BASE_PARAMS, + addUtmParams, +} from "asrouter/content-src/templates/FirstRun/addUtmParams"; // Amount of milliseconds for all transitions to complete (including delays). const TRANSITION_OUT_TIME = 1000; diff --git a/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx b/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx index 3a748e697481..c3af07a02770 100644 --- a/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx +++ b/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { Localized } from "./MSLocalized"; -import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "../lib/aboutwelcome-utils"; import { MobileDownloads } from "./MobileDownloads"; import { MultiSelect } from "./MultiSelect"; import { Themes } from "./Themes"; diff --git a/browser/components/aboutwelcome/content-src/components/ReturnToAMO.jsx b/browser/components/aboutwelcome/content-src/components/ReturnToAMO.jsx index e262e3d92a66..8ae9f7139b46 100644 --- a/browser/components/aboutwelcome/content-src/components/ReturnToAMO.jsx +++ b/browser/components/aboutwelcome/content-src/components/ReturnToAMO.jsx @@ -6,9 +6,9 @@ import React from "react"; import { AboutWelcomeUtils, DEFAULT_RTAMO_CONTENT, -} from "../lib/aboutwelcome-utils.mjs"; +} from "../lib/aboutwelcome-utils"; import { MultiStageProtonScreen } from "./MultiStageProtonScreen"; -import { BASE_PARAMS } from "../lib/addUtmParams.mjs"; +import { BASE_PARAMS } from "asrouter/content-src/templates/FirstRun/addUtmParams"; export class ReturnToAMO extends React.PureComponent { constructor(props) { diff --git a/browser/components/aboutwelcome/content-src/lib/aboutwelcome-utils.mjs b/browser/components/aboutwelcome/content-src/lib/aboutwelcome-utils.js similarity index 100% rename from browser/components/aboutwelcome/content-src/lib/aboutwelcome-utils.mjs rename to browser/components/aboutwelcome/content-src/lib/aboutwelcome-utils.js diff --git a/browser/components/aboutwelcome/content/aboutwelcome.bundle.js b/browser/components/aboutwelcome/content/aboutwelcome.bundle.js index 87693aea5c58..294b4bfe22d9 100644 --- a/browser/components/aboutwelcome/content/aboutwelcome.bundle.js +++ b/browser/components/aboutwelcome/content/aboutwelcome.bundle.js @@ -21,7 +21,7 @@ module.exports = ReactDOM; /***/ }), /* 3 */ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { @@ -35,11 +35,7 @@ __webpack_require__.r(__webpack_exports__); // If the container has a "page" data attribute, then this is // a Spotlight modal or Feature Callout. Otherwise, this is // about:welcome and we should return the current page. -const page = - document.querySelector( - "#multi-stage-message-root.onboardingContainer[data-page]" - )?.dataset.page || document.location.href; - +const page = document.querySelector("#multi-stage-message-root.onboardingContainer[data-page]")?.dataset.page || document.location.href; const AboutWelcomeUtils = { handleUserAction(action) { return window.AWSendToParent("SPECIAL_ACTION", action); @@ -49,9 +45,9 @@ const AboutWelcomeUtils = { event: "IMPRESSION", event_context: { ...context, - page, + page }, - message_id: messageId, + message_id: messageId }); }, sendActionTelemetry(messageId, elementId, eventName = "CLICK_BUTTON") { @@ -59,9 +55,9 @@ const AboutWelcomeUtils = { event: eventName, event_context: { source: elementId, - page, + page }, - message_id: messageId, + message_id: messageId }; window.AWSendEventTelemetry?.(ping); }, @@ -76,11 +72,19 @@ const AboutWelcomeUtils = { let flowParams; try { const response = await fetch(metricsFlowUri, { - credentials: "omit", + credentials: "omit" }); if (response.status === 200) { - const { deviceId, flowId, flowBeginTime } = await response.json(); - flowParams = { deviceId, flowId, flowBeginTime }; + const { + deviceId, + flowId, + flowBeginTime + } = await response.json(); + flowParams = { + deviceId, + flowId, + flowBeginTime + }; } else { console.error("Non-200 response", response); } @@ -90,68 +94,69 @@ const AboutWelcomeUtils = { return flowParams; }, sendEvent(type, detail) { - document.dispatchEvent( - new CustomEvent(`AWPage:${type}`, { - bubbles: true, - detail, - }) - ); + document.dispatchEvent(new CustomEvent(`AWPage:${type}`, { + bubbles: true, + detail + })); }, getLoadingStrategyFor(url) { return url?.startsWith("http") ? "lazy" : "eager"; - }, + } }; - const DEFAULT_RTAMO_CONTENT = { template: "return_to_amo", utm_term: "rtamo", content: { position: "split", - title: { string_id: "mr1-return-to-amo-subtitle" }, + title: { + string_id: "mr1-return-to-amo-subtitle" + }, has_noodles: false, subtitle: { - string_id: "mr1-return-to-amo-addon-title", + string_id: "mr1-return-to-amo-addon-title" }, - backdrop: - "var(--mr-welcome-background-color) var(--mr-welcome-background-gradient)", - background: - "url('chrome://activity-stream/content/data/content/assets/mr-rtamo-background-image.svg') no-repeat center", + backdrop: "var(--mr-welcome-background-color) var(--mr-welcome-background-gradient)", + background: "url('chrome://activity-stream/content/data/content/assets/mr-rtamo-background-image.svg') no-repeat center", progress_bar: true, primary_button: { - label: { string_id: "mr1-return-to-amo-add-extension-label" }, + label: { + string_id: "mr1-return-to-amo-add-extension-label" + }, source_id: "ADD_EXTENSION_BUTTON", action: { type: "INSTALL_ADDON_FROM_URL", - data: { url: null, telemetrySource: "rtamo" }, - }, + data: { + url: null, + telemetrySource: "rtamo" + } + } }, secondary_button: { label: { - string_id: "onboarding-not-now-button-label", + string_id: "onboarding-not-now-button-label" }, source_id: "RTAMO_START_BROWSING_BUTTON", action: { - type: "OPEN_AWESOME_BAR", - }, + type: "OPEN_AWESOME_BAR" + } }, secondary_button_top: { label: { - string_id: "mr1-onboarding-sign-in-button-label", + string_id: "mr1-onboarding-sign-in-button-label" }, source_id: "RTAMO_FXA_SIGNIN_BUTTON", action: { data: { entrypoint: "activity-stream-firstrun", - where: "tab", + where: "tab" }, type: "SHOW_FIREFOX_ACCOUNTS", - addFlowParams: true, - }, - }, - }, + addFlowParams: true + } + } + } }; - /***/ }), /* 4 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -167,11 +172,11 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _MSLocalized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* harmony import */ var _MultiStageProtonScreen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6); /* harmony import */ var _LanguageSwitcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10); /* harmony import */ var _SubmenuButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15); -/* harmony import */ var _lib_addUtmParams_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19); +/* harmony import */ var asrouter_content_src_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -222,7 +227,7 @@ const MultiStageAboutWelcome = props => { filteredScreens.forEach((screen, order) => { if (index === order) { const messageId = `${props.message_id}_${order}_${screen.id}_${screenInitials}`; - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendImpressionTelemetry(messageId, { + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendImpressionTelemetry(messageId, { screen_family: props.message_id, screen_index: order, screen_id: screen.id, @@ -249,7 +254,7 @@ const MultiStageAboutWelcome = props => { (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { (async () => { if (metricsFlowUri) { - setFlowParams(await _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.fetchFlowParams(metricsFlowUri)); + setFlowParams(await _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.fetchFlowParams(metricsFlowUri)); } })(); }, [metricsFlowUri]); @@ -468,7 +473,7 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo } = action; if (type === "SHOW_FIREFOX_ACCOUNTS") { let params = { - ..._lib_addUtmParams_mjs__WEBPACK_IMPORTED_MODULE_6__.BASE_PARAMS, + ...asrouter_content_src_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_6__.BASE_PARAMS, utm_term: `${UTMTerm}-screen` }; if (action.addFlowParams && flowParams) { @@ -483,7 +488,7 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo }; } else if (type === "OPEN_URL") { let url = new URL(data.args); - (0,_lib_addUtmParams_mjs__WEBPACK_IMPORTED_MODULE_6__.addUtmParams)(url, `${UTMTerm}-screen`); + (0,asrouter_content_src_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_6__.addUtmParams)(url, `${UTMTerm}-screen`); if (action.addFlowParams && flowParams) { url.searchParams.append("device_id", flowParams.deviceId); url.searchParams.append("flow_id", flowParams.flowId); @@ -494,7 +499,7 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo args: url.toString() }; } - return _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.handleUserAction({ + return _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.handleUserAction({ type, data }); @@ -515,13 +520,13 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo return; } // Send telemetry before waiting on actions - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, source, event.name); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, source, event.name); // Send additional telemetry if a messaging surface like feature callout is // dismissed via the dismiss button. Other causes of dismissal will be // handled separately by the messaging surface's own code. if (value === "dismiss_button" && !event.name) { - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendDismissTelemetry(props.messageId, source); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendDismissTelemetry(props.messageId, source); } let { action @@ -534,15 +539,15 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo if (["OPEN_URL", "SHOW_FIREFOX_ACCOUNTS"].includes(action.type)) { actionResult = await this.handleOpenURL(action, props.flowParams, props.UTMTerm); } else if (action.type) { - actionResult = await _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.handleUserAction(action); + actionResult = await _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.handleUserAction(action); if (action.type === "FXA_SIGNIN_FLOW") { - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, actionResult ? "sign_in" : "sign_in_cancel", "FXA_SIGNIN_FLOW"); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, actionResult ? "sign_in" : "sign_in_cancel", "FXA_SIGNIN_FLOW"); } // Wait until migration closes to complete the action const hasMigrate = a => a.type === "SHOW_MIGRATION_WIZARD" || a.type === "MULTI_ACTION" && a.data?.actions?.some(hasMigrate); if (hasMigrate(action)) { await window.AWWaitForMigrationClose(); - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, "migrate_close"); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, "migrate_close"); } } @@ -609,7 +614,7 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo action.data.actions.unshift(...multiSelectActions); // Send telemetry with selected checkbox ids - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, props.activeMultiSelect, "SELECT_CHECKBOX"); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(props.messageId, props.activeMultiSelect, "SELECT_CHECKBOX"); } render() { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MultiStageProtonScreen__WEBPACK_IMPORTED_MODULE_3__.MultiStageProtonScreen, { @@ -763,7 +768,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _MSLocalized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* harmony import */ var _MobileDownloads__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7); /* harmony import */ var _MultiSelect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8); /* harmony import */ var _Themes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9); @@ -958,7 +963,7 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom }) { function getLoadingStrategy() { for (let url of [imageURL, darkModeImageURL, reducedMotionImageURL, darkModeReducedMotionImageURL]) { - if (_lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(url) === "lazy") { + if (_lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(url) === "lazy") { return "lazy"; } } @@ -1189,7 +1194,7 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", { className: `${isTheme ? "rtamo-theme-icon" : "brand-logo"}`, src: this.props.iconURL, - loading: _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(this.props.iconURL), + loading: _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(this.props.iconURL), alt: "", role: "presentation" })) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { @@ -1235,7 +1240,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _MSLocalized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1272,7 +1277,7 @@ const MobileDownloads = props => { className: "qr-code-image", alt: typeof QRCode.alt_text === "string" ? QRCode.alt_text : "", src: QRCode.image_url, - loading: _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(QRCode.image_url) + loading: _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.getLoadingStrategyFor(QRCode.image_url) }) : null, showEmailLink ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, { text: props.data.email.link_text }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { @@ -1448,7 +1453,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _MSLocalized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1672,7 +1677,7 @@ function LanguageSwitcher(props) { className: "primary", value: "primary_button", onClick: () => { - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(messageId, "download_langpack"); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendActionTelemetry(messageId, "download_langpack"); setIsAwaitingLangpack(true); } }, content.languageSwitcher.switch ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, { @@ -1747,7 +1752,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1770,7 +1775,7 @@ const HeroImage = props => { height } : null, src: url, - loading: _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.getLoadingStrategyFor(url), + loading: _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.getLoadingStrategyFor(url), alt: alt || "", role: alt ? null : "presentation" })); @@ -2083,7 +2088,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var _MSLocalized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, @@ -2116,11 +2121,11 @@ const AddonsPicker = props => { return; } } - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.handleUserAction({ + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.handleUserAction({ type, data }); - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.sendActionTelemetry(message_id, source_id); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.sendActionTelemetry(message_id, source_id); } return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "addons-picker-container" @@ -2217,7 +2222,7 @@ const LinkParagraph = props => { /***/ }), /* 19 */ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { @@ -2234,7 +2239,7 @@ __webpack_require__.r(__webpack_exports__); const BASE_PARAMS = { utm_source: "activity-stream", utm_campaign: "firstrun", - utm_medium: "referral", + utm_medium: "referral" }; /** @@ -2257,7 +2262,6 @@ function addUtmParams(url, utmTerm) { return returnUrl; } - /***/ }), /* 20 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -2268,9 +2272,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var _MultiStageProtonScreen__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6); -/* harmony import */ var _lib_addUtmParams_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19); +/* harmony import */ var asrouter_content_src_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19); /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -2288,7 +2292,7 @@ class ReturnToAMO extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp async fetchFlowParams() { if (this.props.metricsFlowUri) { this.setState({ - flowParams: await _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.fetchFlowParams(this.props.metricsFlowUri) + flowParams: await _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.fetchFlowParams(this.props.metricsFlowUri) }); } } @@ -2321,7 +2325,7 @@ class ReturnToAMO extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp }; } else if (type === "SHOW_FIREFOX_ACCOUNTS") { let params = { - ..._lib_addUtmParams_mjs__WEBPACK_IMPORTED_MODULE_3__.BASE_PARAMS, + ...asrouter_content_src_templates_FirstRun_addUtmParams__WEBPACK_IMPORTED_MODULE_3__.BASE_PARAMS, utm_term: `aboutwelcome-${utm_term}-screen` }; if (action.addFlowParams && this.state.flowParams) { @@ -2335,11 +2339,11 @@ class ReturnToAMO extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp extraParams: params }; } - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.handleUserAction({ + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.handleUserAction({ type, data }); - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.sendActionTelemetry(message_id, source_id); + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.AboutWelcomeUtils.sendActionTelemetry(message_id, source_id); } render() { const { @@ -2375,7 +2379,7 @@ class ReturnToAMO extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp })); } } -ReturnToAMO.defaultProps = _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_RTAMO_CONTENT; +ReturnToAMO.defaultProps = _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_RTAMO_CONTENT; /***/ }) /******/ ]); @@ -2454,7 +2458,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* harmony import */ var _components_MultiStageAboutWelcome__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4); /* harmony import */ var _components_ReturnToAMO__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } @@ -2491,7 +2495,7 @@ class AboutWelcome extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom domComplete, domInteractive } = performance.getEntriesByType("navigation").pop(); - _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendImpressionTelemetry(this.props.messageId, { + _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.sendImpressionTelemetry(this.props.messageId, { domComplete, domInteractive, mountStart: performance.getEntriesByName("mount").pop().startTime, diff --git a/browser/components/aboutwelcome/karma.mc.config.js b/browser/components/aboutwelcome/karma.mc.config.js index e2fe30816f45..4e08bf7c2e7e 100644 --- a/browser/components/aboutwelcome/karma.mc.config.js +++ b/browser/components/aboutwelcome/karma.mc.config.js @@ -83,7 +83,7 @@ module.exports = function (config) { functions: 0, branches: 0, }, - "content-src/lib/aboutwelcome-utils.mjs": { + "content-src/lib/aboutwelcome-utils.js": { statements: 50, lines: 50, functions: 50, @@ -252,7 +252,7 @@ module.exports = function (config) { }, { enforce: "post", - test: /\.m?js[mx]?$/, + test: /\.js[mx]?$/, loader: "@jsdevtools/coverage-istanbul-loader", options: { esModules: true }, include: [path.resolve("content-src"), path.resolve("modules")], diff --git a/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx b/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx index ed6821327616..72ed00e4163a 100644 --- a/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx +++ b/browser/components/aboutwelcome/tests/unit/MultiStageAboutWelcome.test.jsx @@ -10,7 +10,7 @@ import { Themes } from "content-src/components/Themes"; import React from "react"; import { shallow, mount } from "enzyme"; import { AboutWelcomeDefaults } from "modules/AboutWelcomeDefaults.sys.mjs"; -import { AboutWelcomeUtils } from "content-src/lib/aboutwelcome-utils.mjs"; +import { AboutWelcomeUtils } from "content-src/lib/aboutwelcome-utils"; describe("MultiStageAboutWelcome module", () => { let globals; diff --git a/browser/components/asrouter/.eslintrc.js b/browser/components/asrouter/.eslintrc.js index 7a67e797e6ea..38172ad97e5b 100644 --- a/browser/components/asrouter/.eslintrc.js +++ b/browser/components/asrouter/.eslintrc.js @@ -4,6 +4,11 @@ module.exports = { // When adding items to this file please check for effects on sub-directories. + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, plugins: ["import", "react", "jsx-a11y"], settings: { react: { @@ -13,15 +18,14 @@ module.exports = { extends: ["plugin:jsx-a11y/recommended"], overrides: [ { - // TODO: Bug 1773467 - Move these to .mjs or figure out a generic way - // to identify these as modules. - files: ["content-src/**/*.js", "tests/unit/**/*.js"], + // Only mark the files as modules which are actually modules. + files: ["content-src/**", "tests/unit/**"], parserOptions: { sourceType: "module", }, }, { - files: ["bin/**", "content-src/**", "tests/unit/**"], + files: ["bin/**", "./*.js", "content-src/**", "tests/unit/**"], env: { node: true, }, @@ -39,6 +43,8 @@ module.exports = { rules: { // Disallow commonjs in these directories. "import/no-commonjs": 2, + // Allow JSX with arrow functions. + "react/jsx-no-bind": 0, }, }, { @@ -59,6 +65,7 @@ module.exports = { rules: { "func-name-matching": 0, "lines-between-class-members": 0, + "require-await": 0, }, }, ], @@ -67,10 +74,7 @@ module.exports = { "react/jsx-boolean-value": ["error", "always"], "react/jsx-key": "error", - "react/jsx-no-bind": [ - "error", - { allowArrowFunctions: true, allowFunctions: true }, - ], + "react/jsx-no-bind": "error", "react/jsx-no-comment-textnodes": "error", "react/jsx-no-duplicate-props": "error", "react/jsx-no-target-blank": "error", @@ -93,15 +97,20 @@ module.exports = { "block-scoped-var": "error", "consistent-this": ["error", "use-bind"], eqeqeq: "error", + "for-direction": "error", "func-name-matching": "error", "getter-return": "error", "guard-for-in": "error", + "handle-callback-err": "error", + "lines-between-class-members": "error", "max-depth": ["error", 4], "max-nested-callbacks": ["error", 4], "max-params": ["error", 6], "max-statements": ["error", 50], + "max-statements-per-line": ["error", { max: 2 }], "new-cap": ["error", { newIsCap: true, capIsNew: false }], "no-alert": "error", + "no-buffer-constructor": "error", "no-console": ["error", { allow: ["error"] }], "no-div-regex": "error", "no-duplicate-imports": "error", @@ -111,12 +120,16 @@ module.exports = { "no-implicit-coercion": ["error", { allow: ["!!"] }], "no-implicit-globals": "error", "no-loop-func": "error", + "no-mixed-requires": "error", "no-multi-assign": "error", "no-multi-str": "error", "no-new": "error", "no-new-func": "error", + "no-new-require": "error", "no-octal-escape": "error", "no-param-reassign": "error", + "no-path-concat": "error", + "no-process-exit": "error", "no-proto": "error", "no-prototype-builtins": "error", "no-return-assign": ["error", "except-parens"], @@ -147,6 +160,7 @@ module.exports = { "prefer-spread": "error", "prefer-template": "error", radix: ["error", "always"], + "require-await": "error", "sort-vars": "error", "symbol-description": "error", "vars-on-top": "error", diff --git a/browser/components/asrouter/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx b/browser/components/asrouter/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx index f16dbacbd803..6f0a2a3bf842 100644 --- a/browser/components/asrouter/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx +++ b/browser/components/asrouter/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx @@ -507,6 +507,7 @@ export class ASRouterAdminInner extends React.PureComponent { isBlocked ? null : isModified ? (