Problem with Typescript(?)

Hi! I was trying to use one module in my project and ran into a problem:

There are three errors in IDE, but nothing thrown when Typescript build process is running.

For some reason that works in regular `.ts` file, but not in `.vue` file. When I starting build process there are no errors and everything works as expected, but WebStorm don't think so :).

Here is repo demonstrating this problem: https://github.com/NikitaKA/vuex-smart-module-bug

Github issue (just in case): https://github.com/ktsn/vuex-smart-module/issues/10

 

How can I fix that?

2 comments
Comment actions Permalink

the first issue is caused by problems resolving overloads, it seems to be fixed in 2019.1

the next 2 errors occur because WebStorm static code analysis doesn't understand Vue.extend() - it requires special handling (see https://youtrack.jetbrains.com/issue/WEB-31721 and linked tickets)

I'd suggest trying 2019.1 EAP (https://www.jetbrains.com/webstorm/eap/) - it has introduced advanced TypeScript support in .vue files (https://blog.jetbrains.com/webstorm/2019/01/webstorm-2019-1-early-access-preview/#better_support_for_vue_projects_with_typescript) - it's now possible to use Typescript language service there to get more accurate error highlighting. You can give it a try

 

1
Comment actions Permalink

Installing 2019.1 EAP fixed all problems. Thank you very much!

0

Please sign in to leave a comment.