Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested js property in .jsbeautifyrc file #93

Open
mokkabonna opened this issue Jan 24, 2014 · 3 comments
Open

Support nested js property in .jsbeautifyrc file #93

mokkabonna opened this issue Jan 24, 2014 · 3 comments

Comments

@mokkabonna
Copy link

See beautifier/js-beautify#391 and victorporof/Sublime-HTMLPrettify#74

This needs to be resolved among all the projects imo. This just creates problems for the users.

Best approach IMO for JsFormat would be to support the nested js/html/css approach, but fallback to merging the options at the top level of the config file if no js property exists. This would give you backwards compability as well.

JsFormat does the climbing of parent folders correctly, but the config "wrong" (incompatible with real features of js-beautify, but, hey so does js-beautify itself).

And Sublime-HTMLPrettify does the climb wrong, but the config "right" (IMO, makes the different html/css/js options separate)

Users are left confused :)

@jdavisclark
Copy link
Owner

@mokkabonna I'm a little bit out of the loop here...but what projects actually use the html css sections? What is the source of truth for the file spec?

@mokkabonna
Copy link
Author

Well that's the problem, the actual project (js-beautify) does not define the config file with html/css sections. This is probably since it was originally just for js. But since the project does support HTML/CSS right now, it is leading to other projects taking the logical step from that, meaning adding HTML/CSS to the config as well. It is also an discussion in js-beautify if to include support for html/css in the config or actually just split out the two beautifiers info separate projects.

Meaning users can't use one plugin that expects the config without the html/css parts, with another plugin that do not expect it.

It would help users if because of this current confusion jsformat would actually be "kind" and support both formats. This can be done safely.

HTMLPrettify uses what imo should be the format of the .jsbeautifyrc file
https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options

@jdavisclark
Copy link
Owner

Im with you now. Dug around a little and it looks like this is the 'official' .jsbeautifyrc spec. I don't think I am opposed to supporting the Sublime-HTMLPrettify .jsbeautifyrc format as a fallback; impact is extremely minimal.

The discussion surrounding splitting the js-beautify project up has been going on for a while. I weighed in at one point with a preference for splitting things up, but haven't checked back in a while...

Going to mark this as a low priority feature, but it's simple enough I'll probably get to it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants