Using Laravel/Vue 2 with syntax checking
Hello,
I want in my PhpStorm 2016.2.1 to use Laravel/Vue 2 with syntax checking in IDE.
In settings I set File Types and as I see cgecking of syntax of *.vue workds normally.
But checking of syntax for js-files(that is working example) does not work.
https://imgur.com/a/lv8SG
How to fix it ?
I found that vue-for-idea plugin was mentioned, but the ref is dead ...
Thanks !
Please sign in to leave a comment.
Hi there,
You have to install VueJS plugin (Settings/Preferences | Plugins) -- it will set up own file types and other stuff (files will have own icon etc)
I have this plugin installed
https://imgur.com/a/x7aVC
but I still have errors show on Javascript code :
https://imgur.com/a/NDHfg
Have to install some other plugin or this are some options?
Hi,
You have some old 3rd-party plugin installed which don't seem to work.
Please remove it and install the "Vue.js" plugin from Plugins | Install JetBrains plugin.
Hello,
I did not find the plugin you mentioned.
https://imgur.com/a/gk2os
Could you, please, provide url to this plugin?
I would install it from the disk...
What's your IDE version again? is it PhpStorm 2016.2.1?
If so ... then it's too old as Vue.js plugin made by JetBrains is available from 2017.1 (or perhaps 2016.3) only as far as I know.
Install latest stable 2017.2.4 and see if it will be good there.
Thanks for your help!
I installed new version"
PhpStorm 2017.2.4
Build #PS-172.4155.41, built on September 15, 2017
Licensed to PhpStorm Evaluator
Expiration date: November 18, 2017
with vue plugin installed https://imgur.com/a/d2zKK
I opened working project and see a lot of errors on valid Javascript-code :
https://imgur.com/a/6ViDW
Opening vue file I mannually edited to have 2 errors :
1) <small v-iffffff="erro
2) Removed </template> tag before <script>
I expected to see some errors, but none.
https://imgur.com/a/918Mp
Also all js code shows errors.
Can be deal with some other options ?
Also as all plugins are on(it is visible on 1st printscreen) can it be that
I have to switch some plugins off ?
>Opening vue file I mannually edited to have 2 errors :
1) <small v-iffffff="erro
2) Removed </template> tag before <script>
I expected to see some errors, but none.
https://imgur.com/a/918Mp
That file has .vue extension but still has HTML file icon -- check your file type associations settings -- it must still be using your old (manually created) association (Settings | Editor | File Types). In general: .vue files should have own icon.
>I opened working project and see a lot of errors on valid Javascript-code :
Cannot really help here -- not using VueJS myself and not really a JavaScript person to give insights on possible reasons (but it could be configuration issue from JS side).
yes, after in Settings | Editor | File Types for Vue Templates I added “*.vue”
the syntax inside of *.vue works ok.
But as I use js files(like app.js in printscreens above) I can not assign “*.vue” file to javascript files too.
Looks like assigning of “*.vue” files works only for 1 time of files?
If there is a way to fix it?
>But as I use js files(like app.js in printscreens above) I can not assign “*.vue” file to javascript files too.
But that's .js (JavaScript) file already -- it has JavaScript code only... AFAIK you do not need to do that for this file.
>Looks like assigning of “*.vue” files works only for 1 time of files?
>If there is a way to fix it?
Correct, that's how it's designed. You cannot assign the same extension (pattern) to more than 1 File Type.
BTW, have you setup the right JavaScript language level in PhpStorm settings?
>>> BTW, have you setup the right JavaScript language level in PhpStorm settings?
I am not sure. Could you, please, to point at related link?
https://www.jetbrains.com/help/phpstorm/javascript-2.html