piuccio / sublime-esformatter

JavaScript formatter plugin for Sublime Text
MIT License
28 stars 20 forks source link

error: Error (2):Unable to format #41

Closed doque closed 9 years ago

doque commented 9 years ago

I'm trying to format this code, which includes JSX for a ReactJS component:

var CommentBox = React.createClass({
    render: function() {
        return ( <div className = "commentBox">
            Hello, world! I am a CommentBox.</div>
        );
    }
});

Pressing cmd+alt+f results in a popup with the message

error: Error (2):Unable to format

There are no further errors in the console.

piuccio commented 9 years ago

JSX is not valid javascript. The solution is to allow esformatter plugins, tracked in #40