diff options
author | 2021-03-30 14:52:09 +0000 | |
---|---|---|
committer | 2021-03-30 14:52:09 +0000 | |
commit | d267fa461b73586118437e190b92b9956f9add73 (patch) | |
tree | 50ea72167bb016146fc007abe99c4d72d7e1cd49 /src | |
parent | 3b27eaac4384e82e7f08122f0797a9671470781a (diff) | |
download | astro-d267fa461b73586118437e190b92b9956f9add73.tar.gz astro-d267fa461b73586118437e190b92b9956f9add73.tar.zst astro-d267fa461b73586118437e190b92b9956f9add73.zip |
[ci] npm run format
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/optimize/doctype.ts | 21 | ||||
-rw-r--r-- | src/frontend/h.ts | 4 | ||||
-rw-r--r-- | src/runtime.ts | 12 |
3 files changed, 17 insertions, 20 deletions
diff --git a/src/compiler/optimize/doctype.ts b/src/compiler/optimize/doctype.ts index a666876bf..fdf6c4078 100644 --- a/src/compiler/optimize/doctype.ts +++ b/src/compiler/optimize/doctype.ts @@ -8,26 +8,27 @@ export default function (_opts: { filename: string; fileID: string }): Optimizer html: { Element: { enter(node, parent, _key, index) { - if(node.name === '!doctype') { + if (node.name === '!doctype') { hasDoctype = true; } - if(node.name === 'html' && !hasDoctype) { + if (node.name === 'html' && !hasDoctype) { const dtNode = { - start: 0, end: 0, + start: 0, + end: 0, attributes: [{ type: 'Attribute', name: 'html', value: true, start: 0, end: 0 }], children: [], name: '!doctype', - type: 'Element' + type: 'Element', }; parent.children!.splice(index, 0, dtNode); hasDoctype = true; } - } - } - } + }, + }, + }, }, async finalize() { // Nothing happening here. - } - } -}
\ No newline at end of file + }, + }; +} diff --git a/src/frontend/h.ts b/src/frontend/h.ts index 70965e135..7d26d21d2 100644 --- a/src/frontend/h.ts +++ b/src/frontend/h.ts @@ -6,9 +6,9 @@ export type HTag = string | AstroComponent; const voidTags = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']); function* _h(tag: string, attrs: HProps, children: Array<HChild>) { - if(tag === '!doctype') { + if (tag === '!doctype') { yield '<!doctype '; - if(attrs) { + if (attrs) { yield Object.keys(attrs).join(' '); } yield '>'; diff --git a/src/runtime.ts b/src/runtime.ts index 1b7261dfc..3b2cffefc 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -5,11 +5,7 @@ import type { CompileError } from './parser/utils/error.js'; import { info } from './logger.js'; import { existsSync } from 'fs'; -import { - loadConfiguration, - logger as snowpackLogger, - startServer as startSnowpackServer -} from 'snowpack'; +import { loadConfiguration, logger as snowpackLogger, startServer as startSnowpackServer } from 'snowpack'; interface RuntimeConfig { astroConfig: AstroConfig; @@ -137,10 +133,10 @@ export async function createRuntime(astroConfig: AstroConfig, { logging }: Runti const mountOptions = { [astroRoot.pathname]: '/_astro', - [internalPath.pathname]: '/_astro_internal' - } + [internalPath.pathname]: '/_astro_internal', + }; - if(existsSync(astroConfig.public)) { + if (existsSync(astroConfig.public)) { mountOptions[astroConfig.public.pathname] = '/'; } |