Repository: withastro/astro
File: packages/astro/src/core/errors/errors-data.ts (TypeScript)

Code before:
export const CannotLoadFontProvider = {
	name: 'CannotLoadFontProvider',
	title: 'Cannot load font provider',
	message: (entrypoint: string) => `An error occured while loading the "${entrypoint}" provider.`,
	hint: 'This is an issue with the font provider. Please open an issue on their repository.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font component is used but experimental fonts have not been registered in the config.
 */
export const ExperimentalFontsNotEnabled = {
	name: 'ExperimentalFontsNotEnabled',
	title: 'Experimental fonts are not enabled',
	message:
		'The Font component is used but experimental fonts have not been registered in the config.',
	hint: 'Check that you have enabled experimental fonts and also configured your preferred fonts.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font family not found
 * @message
 * No data was found for the cssVariable passed to the Font component or getFontData function.
 */
export const FontFamilyNotFound = {
	name: 'FontFamilyNotFound',
	title: 'Font family not found',
	message: (family: string) =>
		`No data was found for the \`"${family}"\` family passed to the \`<Font>\` component.`,
	hint: 'This is often caused by a typo. Check that the Font component and getFontData function are using a `cssVariable` specified in your config.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * The CSP feature isn't enabled
 * @message
 * The `experimental.csp` configuration isn't enabled.
 */
export const CspNotEnabled = {
	name: 'CspNotEnabled',
	title: "CSP feature isn't enabled",
	message: "The `experimental.csp` configuration isn't enabled.",
} satisfies ErrorData;

/**
 * @docs
 * @kind heading

Review comment (suggestion):
```suggestion
 * No data was found for the `cssVariable` passed to the `<Font />` component or to the `getFontData()` function.
```

Code after:
export const CannotLoadFontProvider = {
	name: 'CannotLoadFontProvider',
	title: 'Cannot load font provider',
	message: (entrypoint: string) => `An error occured while loading the "${entrypoint}" provider.`,
	hint: 'This is an issue with the font provider. Please open an issue on their repository.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font component is used but experimental fonts have not been registered in the config.
 */
export const ExperimentalFontsNotEnabled = {
	name: 'ExperimentalFontsNotEnabled',
	title: 'Experimental fonts are not enabled',
	message:
		'The Font component is used but experimental fonts have not been registered in the config.',
	hint: 'Check that you have enabled experimental fonts and also configured your preferred fonts.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * Font family not found
 * @message
 * No data was found for the `cssVariable` passed to the `<Font />` component or to the `getFontData()` function.
 */
export const FontFamilyNotFound = {
	name: 'FontFamilyNotFound',
	title: 'Font family not found',
	message: (family: string) =>
		`No data was found for the \`"${family}"\` family passed to the \`<Font>\` component.`,
	hint: 'This is often caused by a typo. Check that the `<Font />` component or `getFontData()` function are using a `cssVariable` specified in your config.',
} satisfies ErrorData;

/**
 * @docs
 * @description
 * The CSP feature isn't enabled
 * @message
 * The `experimental.csp` configuration isn't enabled.
 */
export const CspNotEnabled = {
	name: 'CspNotEnabled',
	title: "CSP feature isn't enabled",
	message: "The `experimental.csp` configuration isn't enabled.",
} satisfies ErrorData;

/**
 * @docs
 * @kind heading