From 2f4e1ba7d85895a9d2ef1531d6d338e55c214a00 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Wed, 5 Aug 2026 14:31:07 -0700 Subject: [PATCH] chore(prettier): ignore ejected swizzles, not wrapped ones --- .prettierignore | 13 ++++++-- src/theme/DocItem/Layout/index.tsx | 8 ++--- src/theme/DocRoot/Layout/Main/index.tsx | 4 +-- src/theme/EditMetaRow/index.tsx | 23 +++++++++---- src/theme/Icon/Edit/index.tsx | 9 +++-- src/theme/Icon/Language/index.tsx | 18 +++++++--- src/theme/Layout/index.tsx | 19 +++++++---- .../LocaleDropdownNavbarItem/index.tsx | 33 +++++++++++-------- src/theme/README.md | 2 +- src/theme/prism-include-languages.ts | 10 +++--- 10 files changed, 90 insertions(+), 49 deletions(-) diff --git a/.prettierignore b/.prettierignore index e523352d6cd..2255dc18b29 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,14 @@ -src/theme/DocItem -src/theme/DocRoot +# Ejected components keep upstream's formatting so they stay diffable against +# @docusaurus/theme-classic. Refer to `src/theme/README.md`. +# Wrapped components are our own code, so they follow the repo's formatting. +src/theme/DocItem/Layout/index.tsx +src/theme/EditMetaRow/index.tsx +src/theme/Icon/Edit/index.tsx +src/theme/Icon/Language/index.tsx +src/theme/Layout/index.tsx +src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +src/theme/prism-include-languages.ts + legacy-stencil-components scripts/bak diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx index 03747ce145e..4e64afe30e9 100644 --- a/src/theme/DocItem/Layout/index.tsx +++ b/src/theme/DocItem/Layout/index.tsx @@ -1,10 +1,10 @@ /** * DocItemLayout is a component that renders the layout of a page like * the individual component pages, guide pages, etc. - * + * * Original source: * @link https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/theme/DocItem/Layout/index.tsx - * + * * Reason for overriding: * - Add a phone demo to the right of the page, e.g. /docs */ @@ -95,8 +95,8 @@ export default function DocItemLayout({children, ...props}: Props): ReactNode { {/* ------- CUSTOM CODE -------- */} {/* Ideally this would only render if there is a demoUrl and the it's a mobile device. However,the `windowSize` does not provide a tablet so we have to hide it through CSS. */} {demoUrl && ( -
-
+
+
diff --git a/src/theme/DocRoot/Layout/Main/index.tsx b/src/theme/DocRoot/Layout/Main/index.tsx index b8a6cf10363..1675410fc68 100644 --- a/src/theme/DocRoot/Layout/Main/index.tsx +++ b/src/theme/DocRoot/Layout/Main/index.tsx @@ -5,10 +5,10 @@ * - Moved the navbar to the top of the page. Originally, the navbar would be placed along the top of the entire site, but we want it to be placed along the top of the docs page only. */ -import React, {type ReactNode} from 'react'; +import React, { type ReactNode } from 'react'; import Main from '@theme-original/DocRoot/Layout/Main'; import Navbar from '@theme/Navbar'; -import type {Props} from '@theme/DocRoot/Layout/Main'; +import type { Props } from '@theme/DocRoot/Layout/Main'; export default function MainWrapper(props: Props): ReactNode { return ( diff --git a/src/theme/EditMetaRow/index.tsx b/src/theme/EditMetaRow/index.tsx index 778bf57bded..9cf50b7229f 100644 --- a/src/theme/EditMetaRow/index.tsx +++ b/src/theme/EditMetaRow/index.tsx @@ -13,29 +13,35 @@ * row. */ -import React, { type ReactNode } from 'react'; +import React, {type ReactNode} from 'react'; import clsx from 'clsx'; // CUSTOM CODE import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; // CUSTOM CODE END import EditThisPage from '@theme/EditThisPage'; -import type { Props } from '@theme/EditMetaRow'; +import type {Props} from '@theme/EditMetaRow'; import LastUpdated from '@theme/LastUpdated'; import globalStyles from '@docusaurus/theme-classic/lib/theme/EditMetaRow/styles.module.css'; import styles from './styles.module.css'; -export default function EditMetaRow({ className, editUrl, lastUpdatedAt, lastUpdatedBy }: Props): ReactNode { +export default function EditMetaRow({ + className, + editUrl, + lastUpdatedAt, + lastUpdatedBy, +}: Props): ReactNode { return (
{/* CUSTOM CODE — "Edit this page | Copy page" as peer links on one row */} -
+
{editUrl && }
@@ -43,7 +49,10 @@ export default function EditMetaRow({ className, editUrl, lastUpdatedAt, lastUpd {/* CUSTOM CODE — wrap the whole column in the conditional, not just its contents */} {(lastUpdatedAt || lastUpdatedBy) && (
- +
)} {/* CUSTOM CODE END */} diff --git a/src/theme/Icon/Edit/index.tsx b/src/theme/Icon/Edit/index.tsx index dfadeaab866..c598a12f2e0 100644 --- a/src/theme/Icon/Edit/index.tsx +++ b/src/theme/Icon/Edit/index.tsx @@ -6,13 +6,13 @@ * - Changed the icon to be the GitHub icon since the icon is used on the `Edit this page` link, which links to the GitHub repo. */ -import React, { type ReactNode } from 'react'; +import React, {type ReactNode} from 'react'; import clsx from 'clsx'; -import type { Props } from '@theme/Icon/Edit'; +import type {Props} from '@theme/Icon/Edit'; import styles from '@docusaurus/theme-classic/src/theme/Icon/Edit/styles.module.css'; -export default function IconEdit({ className, ...restProps }: Props): ReactNode { +export default function IconEdit({className, ...restProps}: Props): ReactNode { return (
{!noFooter &&