From 080156fc65d372038a9663939d6ca58e3a671ea9 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 18 Jun 2024 13:49:42 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/assets/internal.ts | 6 +++--- packages/astro/src/content/runtime-assets.ts | 2 +- packages/astro/src/core/errors/errors-data.ts | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 1f87582c57..8770f27b59 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -3,11 +3,11 @@ import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { DEFAULT_HASH_PROPS } from './consts.js'; import { type ImageService, isLocalService } from './services/service.js'; import { - isImageMetadata, type GetImageResult, type ImageTransform, type SrcSetValue, type UnresolvedImageTransform, + isImageMetadata, } from './types.js'; import { isESMImportedImage, isRemoteImage, resolveSrc } from './utils/imageKind.js'; import { probe } from './utils/remoteProbe.js'; @@ -51,8 +51,8 @@ export async function getImage( ), }); } - - if(isImageMetadata(options)) { + + if (isImageMetadata(options)) { throw new AstroError(AstroErrorData.ExpectedNotESMImage); } diff --git a/packages/astro/src/content/runtime-assets.ts b/packages/astro/src/content/runtime-assets.ts index 91339ef62b..26d98fd6e8 100644 --- a/packages/astro/src/content/runtime-assets.ts +++ b/packages/astro/src/content/runtime-assets.ts @@ -1,7 +1,7 @@ import type { PluginContext } from 'rollup'; import { z } from 'zod'; +import type { ImageMetadata, OmitBrand } from '../assets/types.js'; import { emitESMImage } from '../assets/utils/emitAsset.js'; -import type { OmitBrand, ImageMetadata } from '../assets/types.js'; export function createImage( pluginContext: PluginContext, diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 61ca800e42..790ad631af 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -668,7 +668,7 @@ export const ExpectedImageOptions = { * - [Images](https://docs.astro.build/en/guides/images/) * @description * An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property. - * + * * ```diff * import { getImage } from "astro:assets"; * import myImage from "../assets/my_image.png"; @@ -680,8 +680,9 @@ export const ExpectedImageOptions = { export const ExpectedNotESMImage = { name: 'ExpectedNotESMImage', title: 'Expected image options, not an ESM-imported image.', - message: 'An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.', - hint: 'Try changing `getImage(myImage)` to `getImage({ src: myImage })`' + message: + 'An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.', + hint: 'Try changing `getImage(myImage)` to `getImage({ src: myImage })`', } satisfies ErrorData; /**