Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
code-farmer-i opened this issue Sep 3, 2021 · 3 comments · Fixed by #4506
Labels
🐞 bug Something isn't working scope: script-setup

Comments

@code-farmer-i
Copy link

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

@code-farmer-i
Copy link
Author

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

@edison1105 edison1105 added the 🐞 bug Something isn't working label Sep 3, 2021
@edison1105
Copy link
Member

edison1105 commented Sep 3, 2021

see playground

this will works fine.

interface Props {
  prop1: string
  prop2: string
  prop3: string
}

@edison1105 edison1105 removed the 🐞 bug Something isn't working label Sep 3, 2021
@LinusBorg LinusBorg changed the title The problem of using compiler-sfc to compile script setup sfc-compiler doesn't handle semicolons in interface declarations properly when compiling script setup Sep 3, 2021
@LinusBorg
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: script-setup
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants