vkadam / grunt-jsbeautifier

Beautify js, css, html and json files using Grunt and https://github.com/einars/js-beautify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS: End with newline

claudiojs opened this issue · comments

Hi! Thanks for writing this task!

I was wondering why I can't use this option:
https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify.js#L75

Then I figured it out that the task allways inserts a newline after beautifying a JavaScript file - something that I dont't want to. It is unfortunately impossible to configure it with the parameter options. Could you please change this?

Here is the code that I mean:

return [jsBeautify.js, config.js, true];

and here:

// jsbeautifier would skip the line terminator for js files

This was done way before "end_with_newline" options was added to js-beautify, this was the pull request for it #5.

There is also a pull request #46 for fix but test cases are failing. I will get it correct and honor "end_with_newline"

Pushed fix in version 0.2.9