Atom-beautify: How to turn off space between function and opening bracket?

Created on 22 Aug 2014  路  6Comments  路  Source: Glavin001/atom-beautify

Thanks for the great package!

In this code I don't want beautify to put a whitespace between function and (:

$(function () {
        var el = $('.l-mainMenu');
        if (el.length) {
            new NavigationView({
                el: el
            });
        }
    });

Didn't find the option, is it possible?

question

Most helpful comment

It turned out to be related to jslint-happy parameter in .jsbeautifyrc. I set it to false and it no longer adds the space.

Sorry for wasting your time!

All 6 comments

Thanks, @vorou!

JavaScript beautification is handled by js-beautify. Please take a look there. If there is anything on my end that I can help with to allow for a solution -- such as updating the js-beautify dependency version or even changing beautifiers for JavaScript -- please do not hesitate to let me know and I can reopen this issue :).

I installed js-beautify npm package (1.5.1, just like the one you use) and run it on the file. With default settings it removes the space between function and () (see the example I wrote in the first message). And your plugin somehow puts it back in.

There may be an issue with how the beautification options are loaded. Thanks for further testing on your end!

Would you be able to share your .jsbeautifyrc file?

It turned out to be related to jslint-happy parameter in .jsbeautifyrc. I set it to false and it no longer adds the space.

Sorry for wasting your time!

I'm glad you found a solution! Great to have an issue documenting it for anyone else with same problem :).

Thanks for having this issue documented, just ran into the same problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kuzyn picture kuzyn  路  3Comments

physcocode picture physcocode  路  3Comments

philippelesaux picture philippelesaux  路  4Comments

CorentinAndre picture CorentinAndre  路  4Comments

bartocc picture bartocc  路  5Comments