postalservice14 / vuejs-plugin

[DEPRECATED] Vue.js features for the Intellij Platform (WebStorm, RubyMine, Intellij, etc)
139 stars 20 forks source link

ES6 Fat Arrow Functions #4

Open sagalbot opened 8 years ago

sagalbot commented 8 years ago

I'm having trouble getting phpStorm to recognize ES6 fat arrow functions in my .vue components.

Before:

screen shot 2016-04-20 at 12 02 18 pm

After Code Reformat:

screen shot 2016-04-20 at 12 02 57 pm

I have the JavaScript language version set to ECMAScript 6, and it works great outside of .vue components. Any suggestions?

sagalbot commented 8 years ago
<script type="text/babel"></script>

Fixes the issue, but it'd be great to have this built in.

tyler43636 commented 8 years ago

Thanks @sagalbot. That helped.

cybertino commented 8 years ago

+1. Would be great to have it fixed.

AlexandreBonneau commented 8 years ago

Well, inside .js files, the auto-format is almost broken with this plugin since it sometimes transforms => to = >. There is no way for those .js file to define type="text/babel".

Harbon commented 8 years ago

I was confused , how can I fix this?

crwgregory commented 8 years ago

@Harbon In your script tag in the .vue file:

<template>
    <!-- Your template -->
</template>
<script type="text/babel">
    // Your vue stuff
</script>

The type declaration in the script tag will update the indexer as to what to expect from the code bellow.

AlexandreBonneau commented 8 years ago

Well, I do not remember what I was talking about, since I do not encounter that bug anymore. I therefore consider this 'fixed' :)

hughsaffar commented 7 years ago

It is not fixed! You get random formatting for ES6 syntaxes.

sagalbot commented 7 years ago

@hughsaffar, are you adding the type attribute <script type="text/babel">?

Do you have ES6 set as the default language version as below?

screen shot 2017-02-28 at 6 07 22 pm

hughsaffar commented 7 years ago

I do have ES6 as the default language and it works ok in .js files. But the problem is that it used to work without Githubissues.

  • Githubissues is a development platform for aggregating issues.