I am using Eclipse JSDT and the default formatting settings change something like
var a = 1,
b = 2;
to be on one ugly line.
The style before formatting is recommended by JSLint, so I am wondering can Eclipse be set to format it this way? The existing formatter settings does not offer controls over the comma statement it seems.
Following JavaScript Beautifier plug-in is available for Eclipse.
https://github.com/atlanto/eclipse-javascript-formatter
It can be used to span single statement - multiple variable declarations into multiple lines.
More information about using the above plug-in is given in the README.md
file.
Its a little late I guess, but I do this:
var container = require('../core/container'),
/**/uuid = require('node-uuid'),
/**/validations = require('../util/validations');
Or I do this:
var container = require('../core/container'), //
uuid = require('node-uuid'), //
validations = require('../util/validations');
The second one shifts the variables to the beginning of the line, but that's a trade off you'll have to live with.