Disabling "expression Expected" From PhpStorm 10

- 1 answer

I'm doing some react.js in PhpStorm 10 and even though JSX Harmony is enabled as the JavaScript language level, it still gives all sorts of nonsense errors.

So I disabled inspection completely for JavaScript but it still gives errors like "expression expected" or "Expecting newline or semicolon".

How do I get ride of those for JS?

    <script type="text/babel">
        var MyComponent = React.createClass({
           render: function () {
               return <div>

        React.render(<div><MyComponent text="text1" />
<MyComponent text="text2" /></div>, document.getElementById('container'));

enter image description here



At the moment such inline scripts with type="text/babel" are not supported -- IDE only recognizes text/jsx as type for now. -- watch this ticket (star/vote/comment) to get notified on progress.

Possible workarounds (that I'm aware of):

  • change type to text/jsx (but then the in-browser babel most likely will not transform it, unless you can configure it somehow)
  • keep your JS code in a separate .jsx file

UPDATE: (23/03/2016) The aforementioned ticket is now marked as "Fixed" -- this functionality should be available in next update of 2016.1.