Skip to content

Commit 1d42c25

Browse files
committed
fix(compiler-sfc): add semicolon after defineProps statement
1 parent 9dd006b commit 1d42c25

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/compiler-sfc/src/compileScript.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1122,15 +1122,15 @@ export function compileScript(
11221122
startOffset,
11231123
`\nconst ${propsIdentifier} = __props${
11241124
propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``
1125-
}\n`
1125+
};\n`
11261126
)
11271127
}
11281128
if (propsDestructureRestId) {
11291129
s.prependLeft(
11301130
startOffset,
11311131
`\nconst ${propsDestructureRestId} = ${helper(
11321132
`createPropsRestProxy`
1133-
)}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))})\n`
1133+
)}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))});\n`
11341134
)
11351135
}
11361136

packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export default {
212212
props: propsModel,
213213
setup(__props) {
214214
215-
const props = __props
215+
const props = __props;
216216
217217
218218
@@ -229,7 +229,7 @@ export default {
229229
props: {},
230230
setup(__props) {
231231
232-
const props = __props
232+
const props = __props;
233233
234234
235235
return { props, x }
@@ -245,7 +245,7 @@ exports[`SFC compile <script setup> > defineProps() 1`] = `
245245
},
246246
setup(__props) {
247247
248-
const props = __props
248+
const props = __props;
249249
250250
251251
const bar = 1
@@ -262,7 +262,7 @@ exports[`SFC compile <script setup> > defineProps/defineEmits in multi-variable
262262
emits: ['a'],
263263
setup(__props, { emit }) {
264264
265-
const props = __props
265+
const props = __props;
266266
267267
268268
@@ -278,7 +278,7 @@ exports[`SFC compile <script setup> > defineProps/defineEmits in multi-variable
278278
emits: ['a'],
279279
setup(__props, { emit }) {
280280
281-
const props = __props
281+
const props = __props;
282282
283283
const a = 1;
284284
@@ -803,7 +803,7 @@ export default /*#__PURE__*/_defineComponent({
803803
emits: ['a', 'b'],
804804
setup(__props, { emit }) {
805805
806-
const props = __props
806+
const props = __props;
807807
808808
809809
@@ -892,7 +892,7 @@ const props = __props as {
892892
foo?: string
893893
bar?: number
894894
baz: boolean
895-
}
895+
};
896896
897897
898898
@@ -914,7 +914,7 @@ export default /*#__PURE__*/_defineComponent({
914914
},
915915
setup(__props: any) {
916916
917-
const props = __props as { foo: string, bar?: number, baz: boolean, qux(): number }
917+
const props = __props as { foo: string, bar?: number, baz: boolean, qux(): number };
918918
919919
920920

0 commit comments

Comments
 (0)