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

Typescript template checking on build and run #8654

Closed
RobbinBaauw opened this issue Aug 14, 2018 · 1 comment
Closed

Typescript template checking on build and run #8654

RobbinBaauw opened this issue Aug 14, 2018 · 1 comment

Comments

@RobbinBaauw
Copy link

Version

2.5.17

Reproduction link

https://github.com/RobbinBaauw/vue-ts

Steps to reproduce

  • Clone git repo and install dependencies
  • Run npm run build or npm run dev

What is expected?

(1) In the template of App.vue I use the property 'test' in the click handler of the image. When setting it to a value on click, I should get an error during runtime (and preferably also during compilation, since such an error wouldn't show up when the component isn't enabled which can lead to bugs only found at runtime. That is a problem correct usage of TypeScript could solve).

(2) I also use the property 'test2' in my template, which gives an error, during runtime. Though I would also expect this error during compilation.

What is actually happening?

(1) In the first example I would expect to get an error both during runtime and compilation. I get no error at all right now (when setting a value in a click handler, instead calling a method would invoke an error, during runtime, if that method didn't exist on the component).

(2) In the second example I would expect an error during compilation as well, which I don't get.


These issues might be related, not sure:

Autocompletion in IDEs (e.g. Intellij / Webstorm) using TypeScript also isn't that great yet, as it doesn't seem to recognize that the template belongs to the class, but that is probably a different issue.

Thanks in advance!

@posva
Copy link
Member

posva commented Aug 14, 2018

Let's keep the progress of this at one place at vuejs/vetur#209 🙂
to have ts check this, we would need to add some specific behaviour or plugin to typescript but not much in Vue

@posva posva closed this as completed Aug 14, 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

2 participants