diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index d51a38363d35a..01e98a697855c 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -42,6 +42,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install node.js v18 uses: actions/setup-node@v3 diff --git a/apps/guide/src/app/_global-error.tsx b/apps/guide/src/app/_global-error.tsx index 6a453879d9fd8..bcda8ab37bdc5 100644 --- a/apps/guide/src/app/_global-error.tsx +++ b/apps/guide/src/app/_global-error.tsx @@ -3,7 +3,7 @@ import { Providers } from './providers'; import { inter } from '~/util/fonts'; -export default function GlobalError({ error }: { error: Error }) { +export default function GlobalError({ error }: { readonly error: Error }) { console.error(error); return ( diff --git a/apps/guide/src/app/error.tsx b/apps/guide/src/app/error.tsx index cf88c89518dfa..0fb52ed124d90 100644 --- a/apps/guide/src/app/error.tsx +++ b/apps/guide/src/app/error.tsx @@ -1,6 +1,6 @@ 'use client'; -export default function Error({ error }: { error: Error }) { +export default function Error({ error }: { readonly error: Error }) { console.error(error); return ( diff --git a/apps/guide/src/app/guide/[...slug]/page.tsx b/apps/guide/src/app/guide/[...slug]/page.tsx index ec79e147a291a..ef55b8e35a989 100644 --- a/apps/guide/src/app/guide/[...slug]/page.tsx +++ b/apps/guide/src/app/guide/[...slug]/page.tsx @@ -6,7 +6,7 @@ export async function generateStaticParams() { return allContents.map((content) => ({ slug: [content.slug] })); } -export default function Page({ params }: { params: { slug: string[] } }) { +export default function Page({ params }: { readonly params: { slug: string[] } }) { const content = allContents.find((content) => content.slug === params.slug?.join('/')); if (!content) { diff --git a/apps/guide/src/components/DiscordAPITypesLink.tsx b/apps/guide/src/components/DiscordAPITypesLink.tsx index 4b7f6f1822895..4392b103e157b 100644 --- a/apps/guide/src/components/DiscordAPITypesLink.tsx +++ b/apps/guide/src/components/DiscordAPITypesLink.tsx @@ -12,26 +12,26 @@ interface DiscordAPITypesLinkOptions { * * @example `'RESTJSONErrorCodes'` */ - parent?: string; + readonly parent?: string; /** * The scope of where this link lives. * * @remarks API does not have a scope. */ - scope?: 'gateway' | 'globals' | 'payloads' | 'rest' | 'rpc' | 'utils' | 'voice'; + readonly scope?: 'gateway' | 'globals' | 'payloads' | 'rest' | 'rpc' | 'utils' | 'voice'; /** * The symbol belonging to the parent. * * @example '`MaximumNumberOfGuildsReached'` */ - symbol?: string; + readonly symbol?: string; /** * The type of the {@link DiscordAPITypesLinkOptions.parent}. * * @example `'enum'` * @example `'interface'` */ - type?: string; + readonly type?: string; } export function DiscordAPITypesLink({ diff --git a/apps/guide/src/components/DocsLink.tsx b/apps/guide/src/components/DocsLink.tsx index 658f5d8f94dce..dd0f4d19d0f2c 100644 --- a/apps/guide/src/components/DocsLink.tsx +++ b/apps/guide/src/components/DocsLink.tsx @@ -8,19 +8,19 @@ interface DocsLinkOptions { * * @remarks Functions automatically infer this. */ - brackets?: boolean; + readonly brackets?: boolean; /** * The package. * * @defaultValue `'discord.js'` */ - package?: (typeof PACKAGES)[number]; + readonly package?: (typeof PACKAGES)[number]; /** * The initial documentation class, function, interface etc. * * @example `'Client'` */ - parent?: string; + readonly parent?: string; /** * Whether to reference a static property. * @@ -28,20 +28,20 @@ interface DocsLinkOptions { * This should only be used for the https://discord.js.org domain * as static properties are not identified in the URL. */ - static?: boolean; + readonly static?: boolean; /** * The symbol belonging to the parent. * * @example '`login'` */ - symbol?: string; + readonly symbol?: string; /** * The type of the {@link DocsLinkOptions.parent}. * * @example `'class'` * @example `'Function'` */ - type?: string; + readonly type?: string; } export function DocsLink({ diff --git a/apps/guide/src/components/Mdx.tsx b/apps/guide/src/components/Mdx.tsx index 05f0f89f56a1b..407188b6d7d7c 100644 --- a/apps/guide/src/components/Mdx.tsx +++ b/apps/guide/src/components/Mdx.tsx @@ -10,7 +10,7 @@ import { H4 } from './H4'; import { DocsLink } from '~/components/DocsLink'; import { ResultingCode } from '~/components/ResultingCode'; -export function Mdx({ code }: { code: string }) { +export function Mdx({ code }: { readonly code: string }) { const Component = useMDXComponent(code); return ( diff --git a/apps/guide/src/components/Outline.tsx b/apps/guide/src/components/Outline.tsx index 3700d3176f296..a4c44bb9791ea 100644 --- a/apps/guide/src/components/Outline.tsx +++ b/apps/guide/src/components/Outline.tsx @@ -5,7 +5,7 @@ const LINK_HEIGHT = 30; const INDICATOR_SIZE = 10; const INDICATOR_OFFSET = (LINK_HEIGHT - INDICATOR_SIZE) / 2; -export function Outline({ headings }: { headings: any[] }) { +export function Outline({ headings }: { readonly headings: any[] }) { // eslint-disable-next-line react/hook-use-state const [active /* setActive */] = useState(0); diff --git a/apps/guide/src/components/PageButton.tsx b/apps/guide/src/components/PageButton.tsx index 3cf1dae206142..bd4f1243c0c41 100644 --- a/apps/guide/src/components/PageButton.tsx +++ b/apps/guide/src/components/PageButton.tsx @@ -1,4 +1,12 @@ -export function PageButton({ url, title, direction }: { direction: 'next' | 'prev'; title: string; url: string }) { +export function PageButton({ + url, + title, + direction, +}: { + readonly direction: 'next' | 'prev'; + readonly title: string; + readonly url: string; +}) { return ( ; diff --git a/apps/website/src/app/docs/packages/[package]/[version]/error.tsx b/apps/website/src/app/docs/packages/[package]/[version]/error.tsx index 96631ad5ee102..bcd4b230ba70d 100644 --- a/apps/website/src/app/docs/packages/[package]/[version]/error.tsx +++ b/apps/website/src/app/docs/packages/[package]/[version]/error.tsx @@ -1,6 +1,6 @@ 'use client'; -export default function Error({ error }: { error: Error }) { +export default function Error({ error }: { readonly error: Error }) { console.error(error); return ( diff --git a/apps/website/src/app/error.tsx b/apps/website/src/app/error.tsx index cf88c89518dfa..0fb52ed124d90 100644 --- a/apps/website/src/app/error.tsx +++ b/apps/website/src/app/error.tsx @@ -1,6 +1,6 @@ 'use client'; -export default function Error({ error }: { error: Error }) { +export default function Error({ error }: { readonly error: Error }) { console.error(error); return ( diff --git a/apps/website/src/components/Anchor.tsx b/apps/website/src/components/Anchor.tsx index 450f192a5e69e..b425b8d15e739 100644 --- a/apps/website/src/components/Anchor.tsx +++ b/apps/website/src/components/Anchor.tsx @@ -1,6 +1,6 @@ import { FiLink } from '@react-icons/all-files/fi/FiLink'; -export function Anchor({ href }: { href: string }) { +export function Anchor({ href }: { readonly href: string }) { return ( diff --git a/apps/website/src/components/Badges.tsx b/apps/website/src/components/Badges.tsx index b965664d8f873..68349269eda36 100644 --- a/apps/website/src/components/Badges.tsx +++ b/apps/website/src/components/Badges.tsx @@ -8,7 +8,10 @@ export enum BadgeColor { Warning = 'bg-yellow-500', } -export function Badge({ children, color = BadgeColor.Primary }: PropsWithChildren<{ color?: BadgeColor | undefined }>) { +export function Badge({ + children, + color = BadgeColor.Primary, +}: PropsWithChildren<{ readonly color?: BadgeColor | undefined }>) { return ( Inherited from{' '} diff --git a/apps/website/src/components/ItemLink.tsx b/apps/website/src/components/ItemLink.tsx index 1a2876558c02f..aac85e26c9222 100644 --- a/apps/website/src/components/ItemLink.tsx +++ b/apps/website/src/components/ItemLink.tsx @@ -10,17 +10,17 @@ export interface ItemLinkProps extends Omit, RefAttributes, Omit, keyof LinkProps> { - className?: string; + readonly className?: string; /** * The URI of the api item to link to. (e.g. `/RestManager`) */ - itemURI: string; + readonly itemURI: string; /** * The name of the package the item belongs to. */ - packageName?: string | undefined; + readonly packageName?: string | undefined; } /** diff --git a/apps/website/src/components/Nav.tsx b/apps/website/src/components/Nav.tsx index d59ad505edca5..421c97582d260 100644 --- a/apps/website/src/components/Nav.tsx +++ b/apps/website/src/components/Nav.tsx @@ -9,7 +9,7 @@ import { useNav } from '~/contexts/nav'; const PackageSelect = dynamic(async () => import('./PackageSelect')); const VersionSelect = dynamic(async () => import('./VersionSelect')); -export function Nav({ members }: { members: SidebarSectionItemData[] }) { +export function Nav({ members }: { readonly members: SidebarSectionItemData[] }) { const { opened } = useNav(); return ( diff --git a/apps/website/src/components/Outline.tsx b/apps/website/src/components/Outline.tsx index d4128d97d8e0b..fc7e90c828ebb 100644 --- a/apps/website/src/components/Outline.tsx +++ b/apps/website/src/components/Outline.tsx @@ -4,7 +4,7 @@ import { Scrollbars } from './Scrollbars'; import type { TableOfContentsSerialized } from './TableOfContentItems'; import { TableOfContentItems } from './TableOfContentItems'; -export function Outline({ members }: { members: TableOfContentsSerialized[] }) { +export function Outline({ members }: { readonly members: TableOfContentsSerialized[] }) { return (