From 1e33b070bcf8f9a41cbda08240393207a7637b4e Mon Sep 17 00:00:00 2001 From: HiDeoo <494699+HiDeoo@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:37:54 +0100 Subject: [PATCH] fix: fixes a potential type-checking issue in some Starlight projects --- packages/starlight-links-validator/libs/i18n.ts | 3 +-- packages/starlight-links-validator/libs/validation.ts | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/starlight-links-validator/libs/i18n.ts b/packages/starlight-links-validator/libs/i18n.ts index ea31b6b..b506170 100644 --- a/packages/starlight-links-validator/libs/i18n.ts +++ b/packages/starlight-links-validator/libs/i18n.ts @@ -1,7 +1,6 @@ -import type { StarlightUserConfig } from '@astrojs/starlight/types' - import { ensureLeadingSlash, ensureTrailingSlash } from './path' import type { Headings } from './remark' +import type { StarlightUserConfig } from './validation' export function getLocaleConfig(config: StarlightUserConfig): LocaleConfig | undefined { if (!config.locales || Object.keys(config.locales).length === 0) return diff --git a/packages/starlight-links-validator/libs/validation.ts b/packages/starlight-links-validator/libs/validation.ts index 2e382fc..eeeb9d7 100644 --- a/packages/starlight-links-validator/libs/validation.ts +++ b/packages/starlight-links-validator/libs/validation.ts @@ -2,7 +2,7 @@ import { statSync } from 'node:fs' import { posix } from 'node:path' import { fileURLToPath } from 'node:url' -import type { StarlightUserConfig } from '@astrojs/starlight/types' +import type { StarlightUserConfig as StarlightUserConfigWithPlugins } from '@astrojs/starlight/types' import type { AstroConfig, AstroIntegrationLogger } from 'astro' import { bgGreen, black, blue, dim, green, red } from 'kleur/colors' import picomatch from 'picomatch' @@ -278,3 +278,5 @@ interface ValidationContext { outputDir: URL pages: Pages } + +export type StarlightUserConfig = Omit