[ci] format

This commit is contained in:
FredKSchott 2022-03-29 00:17:02 +00:00 committed by GitHub Actions
parent 4299ab303b
commit 1e3550d5ac
4 changed files with 19 additions and 17 deletions

View file

@ -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>;

View file

@ -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>).

View file

@ -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,7 +53,8 @@ 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({
argsPath.replace(
{
type: 'CallExpression',
callee: {
type: 'MemberExpression',
@ -66,8 +67,9 @@ export default function astro({ config }: AstroPluginOptions): Plugin {
{
type: 'ArrowFunctionExpression',
body: args,
params: []
} as ArrowFunctionExpressionKind);
params: [],
} as ArrowFunctionExpressionKind
);
return false;
},
});