summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/@types/astro.ts4
-rw-r--r--packages/astro/src/runtime/server/index.ts2
-rw-r--r--packages/astro/src/vite-plugin-astro-postprocess/index.ts28
-rw-r--r--packages/astro/src/vite-plugin-markdown/index.ts2
4 files changed, 19 insertions, 17 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index c82d2d7d7..d7d61253d 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -67,7 +67,7 @@ export interface AstroGlobalPartial {
/** @deprecated Use `Astro.glob()` instead. */
fetchContent(globStr: string): Promise<any[]>;
glob(globStr: `${any}.astro`): Promise<ComponentInstance[]>;
- glob<T extends Record<string, any>>(globStr: `${any}.md`): Promise<MarkdownInstance<T>[]>;
+ glob<T extends Record<string, any>>(globStr: `${any}.md`): Promise<MarkdownInstance<T>[]>;
glob<T extends Record<string, any>>(globStr: string): Promise<T[]>;
site: URL;
}
@@ -517,7 +517,7 @@ export interface MarkdownInstance<T extends Record<string, any>> {
file: string;
url: string | undefined;
Content: AstroComponentFactory;
- getHeaders(): Promise<{ depth: number, slug: string, text: string }[]>;
+ getHeaders(): Promise<{ depth: number; slug: string; text: string }[]>;
}
export type GetHydrateCallback = () => Promise<(element: Element, innerHTML: string | null) => void>;
diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts
index 25d41f541..957d3a1cc 100644
--- a/packages/astro/src/runtime/server/index.ts
+++ b/packages/astro/src/runtime/server/index.ts
@@ -291,7 +291,7 @@ function createAstroGlobFn() {
throw new Error(`Astro.glob(${JSON.stringify(globValue())}) - no matches found.`);
}
// Map over the `import()` promises, calling to load them.
- return Promise.all(allEntries.map(fn => fn()));
+ return Promise.all(allEntries.map((fn) => fn()));
};
// Cast the return type because the argument that the user sees (string) is different from the argument
// that the runtime sees post-compiler (Record<string, Module>).
diff --git a/packages/astro/src/vite-plugin-astro-postprocess/index.ts b/packages/astro/src/vite-plugin-astro-postprocess/index.ts
index c0e3ad551..58bd7566d 100644
--- a/packages/astro/src/vite-plugin-astro-postprocess/index.ts
+++ b/packages/astro/src/vite-plugin-astro-postprocess/index.ts
@@ -1,7 +1,7 @@
import { parse as babelParser } from '@babel/parser';
import type { ArrowFunctionExpressionKind, CallExpressionKind, StringLiteralKind } from 'ast-types/gen/kinds';
import type { NodePath } from 'ast-types/lib/node-path';
-import { parse, print, types, visit } from "recast";
+import { parse, print, types, visit } from 'recast';
import type { Plugin } from 'vite';
import type { AstroConfig } from '../@types/astro';
@@ -53,21 +53,23 @@ export default function astro({ config }: AstroPluginOptions): Plugin {
// Wrap the `Astro.glob()` argument with `import.meta.glob`.
const argsPath = path.get('arguments', 0) as NodePath;
const args = argsPath.value;
- argsPath.replace({
- type: 'CallExpression',
- callee: {
- type: 'MemberExpression',
- object: { type: 'MetaProperty', meta: { type: 'Identifier', name: 'import' }, property: { type: 'Identifier', name: 'meta' } },
- property: { type: 'Identifier', name: 'glob' },
- computed: false,
- },
- arguments: [args],
- } as CallExpressionKind,
+ argsPath.replace(
+ {
+ type: 'CallExpression',
+ callee: {
+ type: 'MemberExpression',
+ object: { type: 'MetaProperty', meta: { type: 'Identifier', name: 'import' }, property: { type: 'Identifier', name: 'meta' } },
+ property: { type: 'Identifier', name: 'glob' },
+ computed: false,
+ },
+ arguments: [args],
+ } as CallExpressionKind,
{
type: 'ArrowFunctionExpression',
body: args,
- params: []
- } as ArrowFunctionExpressionKind);
+ params: [],
+ } as ArrowFunctionExpressionKind
+ );
return false;
},
});
diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts
index ebe578783..a250da2af 100644
--- a/packages/astro/src/vite-plugin-markdown/index.ts
+++ b/packages/astro/src/vite-plugin-markdown/index.ts
@@ -76,7 +76,7 @@ export default function markdown({ config }: AstroPluginOptions): Plugin {
},
async load(id) {
// A markdown file has been imported via ESM!
- // Return the file's JS representation, including all Markdown
+ // Return the file's JS representation, including all Markdown
// frontmatter and a deferred `import() of the compiled markdown content.
if (id.startsWith(VIRTUAL_MODULE_ID)) {
const sitePathname = config.buildOptions.site ? new URL(config.buildOptions.site).pathname : '/';