Skip to content

Commit f38856d

Browse files
committed
run prettier
1 parent 25ae0e5 commit f38856d

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

packages/babel-plugin-jsx/src/transform-vue-jsx.ts

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,31 @@ const buildProps = (path: NodePath<t.JSXElement>, state: State) => {
322322
);
323323
if (optimize) {
324324
if (hasClassBinding) {
325-
const klass = propsExpression.properties
326-
.find((prop) => t.isObjectProperty(prop) && t.isStringLiteral(prop.key) && prop.key.value === 'class');
325+
const klass = propsExpression.properties.find(
326+
(prop) =>
327+
t.isObjectProperty(prop) &&
328+
t.isStringLiteral(prop.key) &&
329+
prop.key.value === 'class'
330+
);
327331
if (t.isObjectProperty(klass)) {
328-
klass.value = t.callExpression(createIdentifier(state, 'normalizeClass'), [klass.value as any]);
332+
klass.value = t.callExpression(
333+
createIdentifier(state, 'normalizeClass'),
334+
[klass.value as any]
335+
);
329336
}
330337
}
331338
if (hasStyleBinding) {
332-
const style = propsExpression.properties
333-
.find((prop) => t.isObjectProperty(prop) && t.isStringLiteral(prop.key) && prop.key.value === 'style');
339+
const style = propsExpression.properties.find(
340+
(prop) =>
341+
t.isObjectProperty(prop) &&
342+
t.isStringLiteral(prop.key) &&
343+
prop.key.value === 'style'
344+
);
334345
if (t.isObjectProperty(style)) {
335-
style.value = t.callExpression(createIdentifier(state, 'normalizeStyle'), [style.value as any]);
346+
style.value = t.callExpression(
347+
createIdentifier(state, 'normalizeStyle'),
348+
[style.value as any]
349+
);
336350
}
337351
}
338352
}
@@ -570,18 +584,22 @@ const transformJSXElement = (
570584

571585
const createVNode = t.callExpression(
572586
optimize
573-
? createIdentifier(state, isComponent ? 'createVNode' : 'createElementVNode')
587+
? createIdentifier(
588+
state,
589+
isComponent ? 'createVNode' : 'createElementVNode'
590+
)
574591
: createIdentifier(state, 'createVNode'),
575592
[
576593
tag,
577594
props,
578595
VNodeChild || t.nullLiteral(),
579596
!!patchFlag && optimize && t.numericLiteral(patchFlag),
580-
!!dynamicPropNames.size && optimize&&
597+
!!dynamicPropNames.size &&
598+
optimize &&
581599
t.arrayExpression(
582600
[...dynamicPropNames.keys()].map((name) => t.stringLiteral(name))
583-
),
584-
].filter(Boolean as unknown as ExcludesBoolean),
601+
),
602+
].filter(Boolean as unknown as ExcludesBoolean)
585603
);
586604

587605
if (!directives.length) {

0 commit comments

Comments
 (0)