0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] yarn format

This commit is contained in:
natemoo-re 2021-06-16 21:16:31 +00:00 committed by GitHub Actions
parent 03ebdc3387
commit 5c01526731

View file

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