expression expected when assigning json to javascript variables.

When I do this:

var myObject = {"a":"b"};

Javascript  likes it just fine, but phpStorm reports an error of: "expression expected".

Might I be able to turn this error off without turning off any other errors? 

 

Thanks, 

Ed Greenberg

 

0

I cannot reproduce it (I've tried a JavaScript file and a PHP file with and without <script> tags). In a JSON file I get tons of (different) errors because that is not JSON. Can you please provide more context and maybe a screenshot?

1

If the issue persists after caches invalidation (File > Invalidate Caches/Restart, Invalidate and restart), please share a file that shows up the issue plus a screenshot of the error

0

请先登录再写评论。