diff --git a/src/build.ts b/src/build.ts index 63cdea87d..32b8bcc84 100644 --- a/src/build.ts +++ b/src/build.ts @@ -1,10 +1,7 @@ import type { AstroConfig } from './@types/astro'; import { defaultLogOptions, LogOptions } from './logger'; -import { - loadConfiguration, - startServer as startSnowpackServer, - build as snowpackBuild } from 'snowpack'; +import { loadConfiguration, startServer as startSnowpackServer, build as snowpackBuild } from 'snowpack'; import { promises as fsPromises } from 'fs'; import { relative as pathRelative } from 'path'; import { defaultLogDestination, error } from './logger.js'; @@ -25,7 +22,7 @@ async function* allPages(root: URL): AsyncGenerator { if (info.isDirectory()) { yield* allPages(new URL(fullpath + '/')); } else { - if(/\.(astro|md)$/.test(fullpath.pathname)) { + if (/\.(astro|md)$/.test(fullpath.pathname)) { yield fullpath; } } @@ -39,7 +36,7 @@ export async function build(astroConfig: AstroConfig): Promise<0 | 1> { const runtimeLogging: LogOptions = { level: 'error', - dest: defaultLogDestination + dest: defaultLogDestination, }; const runtime = await createRuntime(astroConfig, { logging: runtimeLogging, env: 'build' }); @@ -48,10 +45,9 @@ export async function build(astroConfig: AstroConfig): Promise<0 | 1> { try { const result = await snowpackBuild({ config: snowpackConfig, - lockfile: null + lockfile: null, }); - - } catch(err) { + } catch (err) { error(logging, 'build', err); return 1; } @@ -64,8 +60,8 @@ export async function build(astroConfig: AstroConfig): Promise<0 | 1> { const outPath = new URL('./' + rel.replace(/\.(astro|md)/, '.html'), dist); const outFolder = new URL('./', outPath); const result = await runtime.load(pagePath); - - if(result.statusCode !== 200) { + + if (result.statusCode !== 200) { error(logging, 'generate', result.error || result.statusCode); //return 1; } else { @@ -80,4 +76,4 @@ export async function build(astroConfig: AstroConfig): Promise<0 | 1> { await runtime.shutdown(); return 0; -} \ No newline at end of file +} diff --git a/src/compiler/optimize/index.ts b/src/compiler/optimize/index.ts index a0291954b..aa5ca58f3 100644 --- a/src/compiler/optimize/index.ts +++ b/src/compiler/optimize/index.ts @@ -73,11 +73,9 @@ export async function optimize(ast: Ast, opts: OptimizeOptions) { const cssVisitors = createVisitorCollection(); const finalizers: Array<() => Promise> = []; - const optimizers = [ - optimizeStyles(opts) - ]; + const optimizers = [optimizeStyles(opts)]; - for(const optimizer of optimizers) { + for (const optimizer of optimizers) { collectVisitors(optimizer, htmlVisitors, cssVisitors, finalizers); } diff --git a/src/parser/parse/acorn.ts b/src/parser/parse/acorn.ts index 7fc0f8f67..c70756d79 100644 --- a/src/parser/parse/acorn.ts +++ b/src/parser/parse/acorn.ts @@ -39,4 +39,4 @@ export const parse_expression_at = (source: string, index: number): number => { // sourceType: 'module', // ecmaVersion: 2020, // locations: true, -// }); \ No newline at end of file +// }); diff --git a/src/parser/parse/read/expression.ts b/src/parser/parse/read/expression.ts index 580c5d62b..6ea0ebc56 100644 --- a/src/parser/parse/read/expression.ts +++ b/src/parser/parse/read/expression.ts @@ -37,4 +37,4 @@ export default function read_expression(parser: Parser): string { } catch (err) { parser.acorn_error(err); } -} \ No newline at end of file +} diff --git a/src/parser/parse/state/tag.ts b/src/parser/parse/state/tag.ts index 1003be14c..bacaffdef 100644 --- a/src/parser/parse/state/tag.ts +++ b/src/parser/parse/state/tag.ts @@ -351,7 +351,7 @@ function read_attribute(parser: Parser, unique_names: Set) { parser.allow_whitespace(); if (parser.eat('...')) { - const {expression} = read_expression(parser); + const { expression } = read_expression(parser); parser.allow_whitespace(); parser.eat('}', true);