[ci] yarn format
This commit is contained in:
parent
03ebdc3387
commit
5c01526731
1 changed files with 6 additions and 3 deletions
|
@ -172,13 +172,16 @@ function getComponentWrapper(_name: string, { url, importSpecifier }: ComponentI
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Evaluate expression (safely) */
|
/** 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 {
|
try {
|
||||||
let { code } = transformSync(raw, {
|
let { code } = transformSync(raw, {
|
||||||
loader: 'tsx',
|
loader: 'tsx',
|
||||||
jsxFactory: 'h',
|
jsxFactory: 'h',
|
||||||
jsxFragment: 'Fragment',
|
jsxFragment: 'Fragment',
|
||||||
charset: 'utf8'
|
charset: 'utf8',
|
||||||
});
|
});
|
||||||
return code;
|
return code;
|
||||||
} catch ({ errors }) {
|
} catch ({ errors }) {
|
||||||
|
@ -197,7 +200,7 @@ function compileExpressionSafe(raw: string, { state, compileOptions, location }:
|
||||||
const frame = codeFrameColumns(text, {
|
const frame = codeFrameColumns(text, {
|
||||||
start: { line: start.line, column: start.character },
|
start: { line: start.line, column: start.character },
|
||||||
end: { line: end.line, column: end.character },
|
end: { line: end.line, column: end.character },
|
||||||
})
|
});
|
||||||
|
|
||||||
err.frame = frame;
|
err.frame = frame;
|
||||||
err.message = e.text;
|
err.message = e.text;
|
||||||
|
|
Loading…
Reference in a new issue