From 81758f1c1e5cbe6827510e26c553790def05f25e Mon Sep 17 00:00:00 2001 From: matthewp Date: Thu, 21 Jul 2022 17:48:45 +0000 Subject: [PATCH] [ci] format --- examples/blog-multiple-authors/astro.config.mjs | 2 +- examples/blog/astro.config.mjs | 2 +- examples/docs/astro.config.mjs | 2 +- packages/astro/src/@types/astro.ts | 8 ++++---- packages/astro/src/core/render/result.ts | 10 ++++------ packages/astro/src/core/render/util.ts | 1 - packages/astro/src/vite-plugin-config-alias/index.ts | 8 ++++++-- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/examples/blog-multiple-authors/astro.config.mjs b/examples/blog-multiple-authors/astro.config.mjs index 2b6a0fe14..44cff71d3 100644 --- a/examples/blog-multiple-authors/astro.config.mjs +++ b/examples/blog-multiple-authors/astro.config.mjs @@ -5,5 +5,5 @@ import preact from '@astrojs/preact'; export default defineConfig({ // Enable the Preact integration to support Preact JSX components. integrations: [preact()], - site: `http://astro.build` + site: `http://astro.build`, }); diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs index 39670fcbd..a6651a593 100644 --- a/examples/blog/astro.config.mjs +++ b/examples/blog/astro.config.mjs @@ -4,5 +4,5 @@ import preact from '@astrojs/preact'; // https://astro.build/config export default defineConfig({ integrations: [preact()], - site: `http://astro.build` + site: `http://astro.build`, }); diff --git a/examples/docs/astro.config.mjs b/examples/docs/astro.config.mjs index da05d8c36..55692c546 100644 --- a/examples/docs/astro.config.mjs +++ b/examples/docs/astro.config.mjs @@ -10,5 +10,5 @@ export default defineConfig({ // Enable React for the Algolia search component. react(), ], - site: `http://astro.build` + site: `http://astro.build`, }); diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 2fa7a4caf..2e6b167c0 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -85,10 +85,10 @@ export interface BuildConfig { * [Astro reference](https://docs.astro.build/reference/api-reference/#astro-global) */ export interface AstroGlobal extends AstroGlobalPartial { - /** + /** * Canonical URL of the current page. * @deprecated Use `Astro.url` instead. - * + * * Example: * ```astro * --- @@ -102,9 +102,9 @@ export interface AstroGlobal extends AstroGlobalPartial { */ clientAddress: string; /** - * A full URL object of the request URL. + * A full URL object of the request URL. * Equivalent to: `new URL(Astro.request.url)` - * + * * [Astro reference](https://docs.astro.build/en/reference/api-reference/#url) */ url: URL; diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index 45190e71d..a7f36ee79 100644 --- a/packages/astro/src/core/render/result.ts +++ b/packages/astro/src/core/render/result.ts @@ -3,7 +3,6 @@ import { bold } from 'kleur/colors'; import type { AstroGlobal, AstroGlobalPartial, - Page, Params, Props, RuntimeMode, @@ -215,12 +214,11 @@ ${extra}` } as unknown as AstroGlobal; Object.defineProperty(Astro, 'canonicalURL', { - get: function() { - warn(args.logging, + get: function () { + warn( + args.logging, 'deprecation', - `${bold( - 'Astro.canonicalURL' - )} is deprecated! Use \`Astro.url\` instead. + `${bold('Astro.canonicalURL')} is deprecated! Use \`Astro.url\` instead. Example: --- diff --git a/packages/astro/src/core/render/util.ts b/packages/astro/src/core/render/util.ts index 2f2c95595..be1e693ef 100644 --- a/packages/astro/src/core/render/util.ts +++ b/packages/astro/src/core/render/util.ts @@ -1,4 +1,3 @@ -import npath from 'path-browserify'; import type { ModuleNode, ViteDevServer } from 'vite'; import type { Metadata } from '../../runtime/server/metadata.js'; diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts index 63360f3b0..782cacc41 100644 --- a/packages/astro/src/vite-plugin-config-alias/index.ts +++ b/packages/astro/src/vite-plugin-config-alias/index.ts @@ -1,7 +1,7 @@ -import type { AstroConfig } from '../@types/astro'; import * as path from 'path'; import * as tsr from 'tsconfig-resolver'; import * as url from 'url'; +import type { AstroConfig } from '../@types/astro'; import type * as vite from 'vite'; @@ -87,7 +87,11 @@ const getConfigAlias = (cwd: string | undefined): Alias[] | null => { }; /** Returns a Vite plugin used to alias pathes from tsconfig.json and jsconfig.json. */ -export default function configAliasVitePlugin({ config: astroConfig }: { config: AstroConfig }): vite.PluginOption { +export default function configAliasVitePlugin({ + config: astroConfig, +}: { + config: AstroConfig; +}): vite.PluginOption { /** Aliases from the tsconfig.json or jsconfig.json configuration. */ const configAlias = getConfigAlias(astroConfig.root && url.fileURLToPath(astroConfig.root));