-
-
Notifications
You must be signed in to change notification settings - Fork 594
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 global declarations handled inconsistently with actual build #159
Comments
And just for record, we are not using much options from users's |
@octref thanks for taking a look at this issue. If you would like, I can provide exactly what you requested, but I think I have something better to help. This issue can easily be reproduced by using this Vue CLI Package, which is a newly created Nuxt/TypeScript starter project. If you setup a new project using that you can follow these steps to reproduce.
I think I understand what you are saying, but I think I have different expectations. The system that I have setup is using this technique to process TypeScript written in a Vue SFC. Essentially the TypeScript in the Vue SFC is being treated identically to any other If I wanted I could move the TypeScript from the SFC into a regular My understanding of your comments is that my expectation may not match yours in this case. I believe, that you are suggesting differently handling for TypeScript in Would it be possible / desired to allow Vetur users the option to specify additional TypeScript configuration that would typically come from My end goal is that VSCode provide good TypeScript code sense and have any errors reported in the editor match actual errors that I would encounter when running the build. This would be a great productivity boost for my team. Thanks again for looking into this issue and please let me know how I can further help. |
Let me look into that. Meanwhile, adding |
Umm, ok. So you are using There is a lot of upcoming changes to Vue + TS like this one: vuejs/vue#5887 Meanwhile in Vetur today, installing |
I am using Vetur with a Nuxt.js Vue project that is using TypeScript. The project uses Webpack and
ts-loader
.One of my
.vue
files is making reference tothis.$router
. Vetur is showing an error on that line that readsProperty $router does not exist on the type default
. When I run the build there is no error. So there is a difference in what I am seeing in the editor vs. the errors my build shows.I would not expect this to be an error because in my
.tsconfig.json
I listvue-router
explicitly intypes
. If I removevue-router
fromtypes
, I get this exact error. So Vetur seems to not be making use oftypes
when generating its code sense.Although
vue-router
is the most significant example I have noticed this issue for all global declarations that I've tested. Just for a test, I tried a similar thing with Jasmine globals and found similar issues.Based on other observations and searching this projects source code, I can see that this extension is attempting to make use of my
tsconfig
. I can't figure out why there would be a problem with this specific setting though.I can work around it with:
This has no affect on the output of the project, but I am making a code change because my editor is inconsistent with my build, which is not ideal.
The text was updated successfully, but these errors were encountered: