Skip to content

Commit

Permalink
Bug 1702166 - Update ESLint, Babel and associated modules to the late…
Browse files Browse the repository at this point in the history
…st versions. r=mossop,nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D110606
  • Loading branch information
Standard8 committed Apr 4, 2021
1 parent 430832d commit 0ba63f7
Show file tree
Hide file tree
Showing 15 changed files with 8,948 additions and 1,564 deletions.
2 changes: 2 additions & 0 deletions .babel-eslint.rc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

module.exports = {
plugins: [
"@babel/plugin-syntax-class-properties",
"@babel/plugin-syntax-jsx",
],
};
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ignorePatterns = [
];

module.exports = {
parser: "babel-eslint",
parser: "@babel/eslint-parser",
parserOptions: {
sourceType: "script",
babelOptions: {
Expand Down
2 changes: 1 addition & 1 deletion browser/components/newtab/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
"plugin:mozilla/mochitest-test",
"plugin:mozilla/xpcshell-test",
"plugin:prettier/recommended", // require("eslint-plugin-prettier")
"prettier/react", // require("eslint-config-prettier")
"prettier", // require("eslint-config-prettier")
],
overrides: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function convertLinks(
data-do_not_autoblock={doNotAutoBlock}
data-entrypoint_name={links[linkTag].entrypoint_name}
data-entrypoint_value={links[linkTag].entrypoint_value}
rel="noreferrer"
onClick={sendClick}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ export class _CollapsibleSection extends React.PureComponent {
titleStyle = { visibility: "hidden" };
}
return (
// TODO: Bug 1702140: re-enable this rule.
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
<section
className={`collapsible-section ${this.props.className}${
enableAnimation ? " animation-enabled" : ""
Expand Down
116 changes: 61 additions & 55 deletions browser/components/newtab/data/content/activity-stream.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5893,61 +5893,66 @@ class _CollapsibleSection extends react__WEBPACK_IMPORTED_MODULE_3___default.a.P
};
}

return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("section", {
className: `collapsible-section ${this.props.className}${enableAnimation ? " animation-enabled" : ""}${collapsed ? " collapsed" : ""}${active ? " active" : ""}`,
"aria-expanded": !collapsed // Note: data-section-id is used for web extension api tests in mozilla central
,
"data-section-id": id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "section-top-bar"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("h3", {
className: "section-title",
style: titleStyle
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "click-target-container"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "click-target",
role: "button",
tabIndex: "0",
onKeyPress: this.onKeyPress,
onClick: this.onHeaderClick
}, !isNewNewtabExperienceEnabled && this.renderIcon(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_FluentOrText_FluentOrText__WEBPACK_IMPORTED_MODULE_2__["FluentOrText"], {
message: title
}), !isNewNewtabExperienceEnabled && isCollapsible && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
"data-l10n-id": collapsed ? "newtab-section-expand-section-label" : "newtab-section-collapse-section-label",
className: `collapsible-arrow icon ${collapsed ? "icon-arrowhead-forward-small" : "icon-arrowhead-down-small"}`
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "learn-more-link-wrapper"
}, learnMore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "learn-more-link"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_FluentOrText_FluentOrText__WEBPACK_IMPORTED_MODULE_2__["FluentOrText"], {
message: learnMore.link.message
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("a", {
href: learnMore.link.href
})))))), !isNewNewtabExperienceEnabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_ContextMenu_ContextMenuButton__WEBPACK_IMPORTED_MODULE_7__["ContextMenuButton"], {
tooltip: "newtab-menu-section-tooltip",
onUpdate: this.onMenuUpdate,
refFunction: this.setContextMenuButtonRef
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_SectionMenu_SectionMenu__WEBPACK_IMPORTED_MODULE_5__["SectionMenu"], {
id: id,
extraOptions: extraMenuOptions,
source: eventSource,
showPrefName: showPrefName,
privacyNoticeURL: privacyNoticeURL,
collapsed: collapsed,
isFixed: isFixed,
isFirst: isFirst,
isLast: isLast,
dispatch: dispatch,
isWebExtension: isWebExtension
})))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_ErrorBoundary_ErrorBoundary__WEBPACK_IMPORTED_MODULE_1__["ErrorBoundary"], {
className: "section-body-fallback"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: `section-body${isAnimating ? " animating" : ""}`,
onTransitionEnd: this.onTransitionEnd,
ref: this.onBodyMount,
style: bodyStyle
}, this.props.children)));
return (
/*#__PURE__*/
// TODO: Bug 1702140: re-enable this rule.
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("section", {
className: `collapsible-section ${this.props.className}${enableAnimation ? " animation-enabled" : ""}${collapsed ? " collapsed" : ""}${active ? " active" : ""}`,
"aria-expanded": !collapsed // Note: data-section-id is used for web extension api tests in mozilla central
,
"data-section-id": id
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "section-top-bar"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("h3", {
className: "section-title",
style: titleStyle
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "click-target-container"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "click-target",
role: "button",
tabIndex: "0",
onKeyPress: this.onKeyPress,
onClick: this.onHeaderClick
}, !isNewNewtabExperienceEnabled && this.renderIcon(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_FluentOrText_FluentOrText__WEBPACK_IMPORTED_MODULE_2__["FluentOrText"], {
message: title
}), !isNewNewtabExperienceEnabled && isCollapsible && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
"data-l10n-id": collapsed ? "newtab-section-expand-section-label" : "newtab-section-collapse-section-label",
className: `collapsible-arrow icon ${collapsed ? "icon-arrowhead-forward-small" : "icon-arrowhead-down-small"}`
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "learn-more-link-wrapper"
}, learnMore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
className: "learn-more-link"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_FluentOrText_FluentOrText__WEBPACK_IMPORTED_MODULE_2__["FluentOrText"], {
message: learnMore.link.message
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("a", {
href: learnMore.link.href
})))))), !isNewNewtabExperienceEnabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_ContextMenu_ContextMenuButton__WEBPACK_IMPORTED_MODULE_7__["ContextMenuButton"], {
tooltip: "newtab-menu-section-tooltip",
onUpdate: this.onMenuUpdate,
refFunction: this.setContextMenuButtonRef
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_SectionMenu_SectionMenu__WEBPACK_IMPORTED_MODULE_5__["SectionMenu"], {
id: id,
extraOptions: extraMenuOptions,
source: eventSource,
showPrefName: showPrefName,
privacyNoticeURL: privacyNoticeURL,
collapsed: collapsed,
isFixed: isFixed,
isFirst: isFirst,
isLast: isLast,
dispatch: dispatch,
isWebExtension: isWebExtension
})))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(content_src_components_ErrorBoundary_ErrorBoundary__WEBPACK_IMPORTED_MODULE_1__["ErrorBoundary"], {
className: "section-body-fallback"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: `section-body${isAnimating ? " animating" : ""}`,
onTransitionEnd: this.onTransitionEnd,
ref: this.onBodyMount,
style: bodyStyle
}, this.props.children)))
);
}

}
Expand Down Expand Up @@ -11816,6 +11821,7 @@ function convertLinks(links, sendClick, doNotAutoBlock, openNewWindow = false) {
"data-do_not_autoblock": doNotAutoBlock,
"data-entrypoint_name": links[linkTag].entrypoint_name,
"data-entrypoint_value": links[linkTag].entrypoint_value,
rel: "noreferrer",
onClick: sendClick
});
return acc;
Expand Down
4 changes: 2 additions & 2 deletions devtools/client/debugger/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

module.exports = {
plugins: ["react", "mozilla", "babel", "prettier", "import", "file-header"],
plugins: ["react", "mozilla", "@babel", "prettier", "import", "file-header"],
globals: {
atob: true,
btoa: true,
Expand All @@ -29,7 +29,7 @@ module.exports = {
global: true,
L10N: true,
},
extends: ["prettier", "prettier/react", "plugin:jest/recommended"],
extends: ["prettier", "plugin:jest/recommended"],
parserOptions: {
ecmaVersion: 2016,
sourceType: "module",
Expand Down
5 changes: 2 additions & 3 deletions devtools/client/webconsole/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"plugins": [
"transform-flow-strip-types",
"transform-react-jsx",
"transform-object-rest-spread"
"@babel/transform-flow-strip-types",
"@babel/plugin-transform-react-jsx",
]
}
Loading

0 comments on commit 0ba63f7

Please sign in to comment.