Reputation: 14580
I have the following option enabled:
code-style -> javascript -> keep when reformatting -> line breaks
And yet IntelliJ insists on changing e.g.
var arrrr=[{
},{
}];
to
var arrrr = [
{
},
{
}
];
I have braces placement set to "end of line" for everything, every other wrapping option says "do not force" or "do not wrap", etc... Am I missing something, or is it a bug?
Alternatively, are there any plugins that would allow me to reformat javascript/json in the first format?
Upvotes: 2
Views: 935
Reputation: 14580
I solved this using the Eclipse Code Formatter plugin - http://plugins.jetbrains.com/plugin/?idea&id=6546
Plugin installation instructions here http://www.jetbrains.com/idea/webhelp/installing-updating-and-uninstalling-repository-plugins.html
Configuration instructions here https://github.com/krasa/EclipseCodeFormatter#instructions
Summary:
Now IntelliJ will use the eclipse formatter instead of its own.
Very useful too if you're working with a team that are using eclipse, so you can all use the same formatting options.
Upvotes: 2