Subscribe on changes!

sfc-compiler doesn't handle semicolons in interface declarations properly when compiling script setup

avatar
Sep 3rd 2021

Version

3.2.8

Reproduction link

github.com

Steps to reproduce

git clone yarn node build.js

What is expected?

Grammatical errors

What is actually happening?

Grammatically correct

avatar
Sep 3rd 2021

I tried to compile the Sfc file into a ts file through compiler-sfc. After the compilation was completed, I found a syntax error in the ts file.

Sfc

Compile to ts

avatar
Sep 3rd 2021

see playground

this will works fine.

interface Props {
  prop1: string
  prop2: string
  prop3: string
}
avatar
Sep 3rd 2021

Semicolons are valid in Type declarations (even though not commonly used in my experience), so this should be rated as a bug