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

VisualStudio Code shows errors in new project #1261

Closed
xcambar opened this issue May 11, 2018 · 5 comments
Closed

VisualStudio Code shows errors in new project #1261

xcambar opened this issue May 11, 2018 · 5 comments

Comments

@xcambar
Copy link

xcambar commented May 11, 2018

Version

3.0.0-beta.6

Reproduction link

https://github.com/xcambar/vue-cli-lint-error-typescript

Steps to reproduce

  • vue create name-of-your-project
  • Select only the "TypeScript" option
  • open HelloWorld.vue in VSCode

What is expected?

The linter service and VSCode should provide the same amount of feedback to the user.

What is actually happening?

The linter service does not throw any error, but VSCode does.


I'm new to vue-cli, and despite my Google-fu, I may have missed something.

@yibuyisheng
Copy link
Contributor

#1198 ?

@xcambar
Copy link
Author

xcambar commented May 11, 2018

Unfortunately no (or I don't understand the solution): the example repo already contains the declarations as 2 separated files shims-tsx.d.ts and shims-vue.d.ts

@kumorig
Copy link

kumorig commented May 11, 2018

I can confirm this issue, and I'm pretty sure it has to do with the typescript version. The vetur-extension in vscode installs with devDependencies:{"typescript": "^2.6.2"} (looking at %USERPROFILE%\.vscode\extensions\octref.vetur-0.11.7\package.json ) but https://github.com/vuejs/vetur/blob/master/package.json has "typescript": "^2.8.1", but vetur@0.11.7 is the same version so whats up with that?

Anyway, definite assignment assertions (the exclamation marks after variables), where your code breaks the linter, were introduced in typescript v2.7

@kumorig
Copy link

kumorig commented May 11, 2018

Workaround here: vuejs/vetur#682

@xcambar
Copy link
Author

xcambar commented May 11, 2018

I confirm the fix described in vuejs/vetur#682 (comment) works, thanks @kumorig !

It will do before Vetur 0.11.8 is published 👍

@xcambar xcambar closed this as completed May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants