summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar natemoo-re <natemoo-re@users.noreply.github.com> 2021-06-16 21:16:31 +0000
committerGravatar GitHub Actions <actions@github.com> 2021-06-16 21:16:31 +0000
commit5c01526731ada6bc41b334d1630bf472e2690126 (patch)
tree6f4bc61fea137c7f16db289839d9fc770d6d4482
parent03ebdc3387b2b184e2767de26234e6ad4aea20c9 (diff)
downloadastro-5c01526731ada6bc41b334d1630bf472e2690126.tar.gz
astro-5c01526731ada6bc41b334d1630bf472e2690126.tar.zst
astro-5c01526731ada6bc41b334d1630bf472e2690126.zip
[ci] yarn format
-rw-r--r--packages/astro/src/compiler/codegen/index.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts
index fe0905f8c..be0e1d17c 100644
--- a/packages/astro/src/compiler/codegen/index.ts
+++ b/packages/astro/src/compiler/codegen/index.ts
@@ -172,13 +172,16 @@ function getComponentWrapper(_name: string, { url, importSpecifier }: ComponentI
}
/** Evaluate expression (safely) */
-function compileExpressionSafe(raw: string, { state, compileOptions, location }: { state: CodegenState, compileOptions: CompileOptions, location: { start: number, end: number } }): string|null {
+function compileExpressionSafe(
+ raw: string,
+ { state, compileOptions, location }: { state: CodegenState; compileOptions: CompileOptions; location: { start: number; end: number } }
+): string | null {
try {
let { code } = transformSync(raw, {
loader: 'tsx',
jsxFactory: 'h',
jsxFragment: 'Fragment',
- charset: 'utf8'
+ charset: 'utf8',
});
return code;
} catch ({ errors }) {
@@ -197,7 +200,7 @@ function compileExpressionSafe(raw: string, { state, compileOptions, location }:
const frame = codeFrameColumns(text, {
start: { line: start.line, column: start.character },
end: { line: end.line, column: end.character },
- })
+ });
err.frame = frame;
err.message = e.text;