gcorne / wp-react-boilerplate

Get started with using React in a WordPress plugin
129 stars 27 forks source link

Rename JSX files to use .jsx extension. #4

Closed iandunn closed 8 years ago

iandunn commented 8 years ago

This helps IDEs and text editors correctly identify the file type so that they can perform syntax highlighting, code sniffing, etc.

gcorne commented 8 years ago

Since switching to using Babel, which handles both the transformation of ES6=>ES5 and JSX=>JS, all javascript files are passed through the transpiler, so I don't think using the jsx extension is a good idea. It means that files have to be renamed if JSX is added, adds a little complexity, and is a convention that is easy to sidestep because using .jsx isn't necessary for the JSX=>JS transformation to occur.

iandunn commented 8 years ago

Cool, thanks for taking the time to look at it :)