Skip to content

Commit

Permalink
fix: minor type issues in starlight (#1706)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
  • Loading branch information
jorenbroekema and delucis committed Apr 9, 2024
1 parent c5cd181 commit f171ac4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-crabs-press.md
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes some minor type errors
3 changes: 2 additions & 1 deletion packages/starlight/integrations/shared/pathToLocale.ts
@@ -1,3 +1,4 @@
import type { AstroConfig } from 'astro';
import type { StarlightConfig } from '../../types';

function slugToLocale(
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/rehype-file-tree.ts
Expand Up @@ -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;
Expand Down

0 comments on commit f171ac4

Please sign in to comment.