Reputation: 2370
My javascript code is formatted like this and I'm not comfortable with this :
function(
req,
req.session,
amount,
offerCode,
userChoice,
referenceNo,
transactionId,
function (err, res) {
...
}
I prefer to change it like this :
function( req, req.session, amount, offerCode, userChoice, eferenceNo, transactionId, function (err, res) {
...
}
Is there any code-formatter to do this automatically on a huge bunch of code.
Upvotes: 2
Views: 3312
Reputation: 167172
The best thing to use is Prettier - Code formatter in this case. Use a file called .prettierrc
in your root of the folder that you put into VS Code and add the following inside it:
{
"printWidth": 8000
}
The default is 80
in this case.
Upvotes: 8