diff --git a/.changeset/shaggy-crabs-press.md b/.changeset/shaggy-crabs-press.md new file mode 100644 index 0000000000..4172a8efee --- /dev/null +++ b/.changeset/shaggy-crabs-press.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fixes some minor type errors diff --git a/packages/starlight/integrations/shared/pathToLocale.ts b/packages/starlight/integrations/shared/pathToLocale.ts index aa8748cdd0..5c229a4739 100644 --- a/packages/starlight/integrations/shared/pathToLocale.ts +++ b/packages/starlight/integrations/shared/pathToLocale.ts @@ -1,3 +1,4 @@ +import type { AstroConfig } from 'astro'; import type { StarlightConfig } from '../../types'; function slugToLocale( @@ -17,7 +18,7 @@ export function pathToLocale( astroConfig, }: { starlightConfig: { locales: StarlightConfig['locales'] }; - astroConfig: { root: URL; srcDir: URL }; + astroConfig: { root: AstroConfig['root']; srcDir: AstroConfig['srcDir'] }; } ): string | undefined { const srcDir = new URL(astroConfig.srcDir, astroConfig.root); diff --git a/packages/starlight/user-components/rehype-file-tree.ts b/packages/starlight/user-components/rehype-file-tree.ts index 5af454fe32..2f96d5c5e9 100644 --- a/packages/starlight/user-components/rehype-file-tree.ts +++ b/packages/starlight/user-components/rehype-file-tree.ts @@ -168,7 +168,7 @@ function getFileIcon(fileName: string) { /** Return the icon name for a file based on its file name. */ function getFileIconName(fileName: string) { - let icon = definitions.files[fileName]; + let icon: string | undefined = definitions.files[fileName]; if (icon) return icon; icon = getFileIconTypeFromExtension(fileName); if (icon) return icon;