问题
I'm using PHPStorm 8.0.3 for my current project, but unfortunately it doesn't support JSX. In my React components (which are then compiled by Browserify) HTML gets underlined in red and invalidated:

This is just a small component, but it surely gets pretty annoying with bigger ones. Also code formatting doesn't work as expected.
- Is there a (hard to find) setting which enables the correct syntax highlighting?
- If there is no such setting, is it possible to download a corresponding package?
- If there is no support at all, how do I extend PHPStorm (maybe by a custom Color/Syntax Schema) to accept HTML within my js files?
回答1:
I had the same problem and solution is to either use JSX Harmony on PHPStorm 8:
Preferences / Languages & Frameworks / JavaScript
set JavaScript language version
to JSX Harmony
or move to PHPStorm 9 EAP. I hope PHPStorm 9 will be available soon, though (as I had performance issue with EAP version).
回答2:
on PHPStorm 7:
File->setting->Languages & Frameworks->JavaScript->
Select the option React JSX in the drop down list (JavaScript Language version)
来源:https://stackoverflow.com/questions/30309690/phpstorm-jsx-react-syntax-highlighting