From 43dda86ce2577d6930acdc9a8261ee65d43705d8 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Fri, 10 Jun 2022 18:20:21 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/errors.ts | 5 ++--- packages/astro/src/vite-plugin-markdown/index.ts | 4 ++-- packages/integrations/sitemap/package.json | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/astro/src/core/errors.ts b/packages/astro/src/core/errors.ts index fa80414e18..8393f0d83e 100644 --- a/packages/astro/src/core/errors.ts +++ b/packages/astro/src/core/errors.ts @@ -69,12 +69,11 @@ export function collectErrorMetadata(e: any): ErrorWithMetadata { (e as any).stack = eol.lf((e as any).stack); } - if (e.name === 'YAMLException') { const err = e as SSRError; - err.loc = { file: (e as any).id, line: (e as any).mark.line, column: (e as any).mark.column } + err.loc = { file: (e as any).id, line: (e as any).mark.line, column: (e as any).mark.column }; err.message = (e as any).reason; - + if (!err.frame) { try { const fileContents = fs.readFileSync(err.loc.file!, 'utf8'); diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts index 90b25625f9..29bc629e35 100644 --- a/packages/astro/src/vite-plugin-markdown/index.ts +++ b/packages/astro/src/vite-plugin-markdown/index.ts @@ -8,9 +8,9 @@ import { fileURLToPath } from 'url'; import type { Plugin } from 'vite'; import type { AstroConfig } from '../@types/astro'; import { pagesVirtualModuleId } from '../core/app/index.js'; +import { collectErrorMetadata } from '../core/errors.js'; import { prependForwardSlash } from '../core/path.js'; import { resolvePages, viteID } from '../core/util.js'; -import { collectErrorMetadata } from '../core/errors.js'; import { PAGE_SSR_SCRIPT_ID } from '../vite-plugin-scripts/index.js'; import { getFileInfo } from '../vite-plugin-utils/index.js'; @@ -26,7 +26,7 @@ function safeMatter(source: string, id: string) { return matter(source); } catch (e) { (e as any).id = id; - throw collectErrorMetadata(e) + throw collectErrorMetadata(e); } } diff --git a/packages/integrations/sitemap/package.json b/packages/integrations/sitemap/package.json index 7ba590018f..ec53b20f0f 100644 --- a/packages/integrations/sitemap/package.json +++ b/packages/integrations/sitemap/package.json @@ -26,8 +26,7 @@ "build:ci": "astro-scripts build \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"" }, - "dependencies": { - }, + "dependencies": {}, "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*"