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

Code before:
 *
 * <!-- GOOD: `src` is a URL. -->
 * <Image src="https://example.com/my_image.png" alt="Cool image" />
 *
 * <!-- BAD: `src` is an image's `src` path instead of the full image object. -->
 * <Image src={myImage.src} alt="Cool image" />
 *
 * <!-- BAD: `src` is a string filepath. -->
 * <Image src="../my_image.png" alt="Cool image" />
 * ```
 */
export const LocalImageUsedWrongly = {
	name: 'LocalImageUsedWrongly',
	title: 'Local images must be imported.',
	message: (imageFilePath: string) =>
		`\`Image\`'s and \`getImage\`'s \`src\` parameter must be an imported image or an URL, it cannot be a string filepath. Received \`${imageFilePath}\`.`,
	hint: 'If you want to use an image from your `src` folder, you need to either import it or if the image is coming from a content collection, use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections). See https://docs.astro.build/en/guides/images/#src-required for more information on the `src` property.',
} satisfies ErrorData;

/**
 * @docs
 * @see
 * - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
 * @description
 * `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.
 * @deprecated Removed in Astro v6.0.0 as it is no longer relevant due to the removal of `Astro.glob()`.
 */
export const AstroGlobUsedOutside = {
	name: 'AstroGlobUsedOutside',
	title: 'Astro.glob() used outside of an Astro file.',
	message: (globStr: string) =>
		`\`Astro.glob(${globStr})\` can only be used in \`.astro\` files. \`import.meta.glob(${globStr})\` can be used instead to achieve a similar result.`,
	hint: "See Vite's documentation on `import.meta.glob` for more information: https://vite.dev/guide/features.html#glob-import",
} satisfies ErrorData;

/**
 * @docs
 * @see
 * - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
 * @description
 * `Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.
 * @deprecated Removed in Astro v6.0.0 as it is no longer relevant due to the removal of `Astro.glob()`.
 */
export const AstroGlobNoMatch = {
	name: 'AstroGlobNoMatch',
	title: 'Astro.glob() did not match any files.',
	message: (globStr: string) => `\`Astro.glob(${globStr})\` did not return any matching files.`,
	hint: 'Check the pattern for typos.',
} satisfies ErrorData;
/**
 * @docs

Review comment (suggestion):
```suggestion
 * @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
```

Code after:
 *
 * <!-- GOOD: `src` is a URL. -->
 * <Image src="https://example.com/my_image.png" alt="Cool image" />
 *
 * <!-- BAD: `src` is an image's `src` path instead of the full image object. -->
 * <Image src={myImage.src} alt="Cool image" />
 *
 * <!-- BAD: `src` is a string filepath. -->
 * <Image src="../my_image.png" alt="Cool image" />
 * ```
 */
export const LocalImageUsedWrongly = {
	name: 'LocalImageUsedWrongly',
	title: 'Local images must be imported.',
	message: (imageFilePath: string) =>
		`\`Image\`'s and \`getImage\`'s \`src\` parameter must be an imported image or an URL, it cannot be a string filepath. Received \`${imageFilePath}\`.`,
	hint: 'If you want to use an image from your `src` folder, you need to either import it or if the image is coming from a content collection, use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections). See https://docs.astro.build/en/guides/images/#src-required for more information on the `src` property.',
} satisfies ErrorData;

/**
 * @docs
 * @see
 * - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
 * @description
 * `Astro.glob()` can only be used in `.astro` files. You can use [`import.meta.glob()`](https://vite.dev/guide/features.html#glob-import) instead to achieve the same result.
 * @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
 */
export const AstroGlobUsedOutside = {
	name: 'AstroGlobUsedOutside',
	title: 'Astro.glob() used outside of an Astro file.',
	message: (globStr: string) =>
		`\`Astro.glob(${globStr})\` can only be used in \`.astro\` files. \`import.meta.glob(${globStr})\` can be used instead to achieve a similar result.`,
	hint: "See Vite's documentation on `import.meta.glob` for more information: https://vite.dev/guide/features.html#glob-import",
} satisfies ErrorData;

/**
 * @docs
 * @see
 * - [Astro.glob](https://docs.astro.build/en/reference/api-reference/#astroglob)
 * @description
 * `Astro.glob()` did not return any matching files. There might be a typo in the glob pattern.
 * @deprecated This error was removed in Astro v6.0.0 along with the removal of `Astro.glob()`.
 */
export const AstroGlobNoMatch = {
	name: 'AstroGlobNoMatch',
	title: 'Astro.glob() did not match any files.',
	message: (globStr: string) => `\`Astro.glob(${globStr})\` did not return any matching files.`,
	hint: 'Check the pattern for typos.',
} satisfies ErrorData;
/**
 * @docs