-
Notifications
You must be signed in to change notification settings - Fork 222
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 comma first style of variable declaration #59
Comments
"Tweaked easily": That is a relative term. You'll want to file this with the upstream project https://github.com/einars/js-beautify . |
Agreed. But the author has already provided the fix. If my Python-fu was strong enough, I would have sent you a pull request already. |
You don't need python-fu to work in javascript - js-beautify has both javascript and python implementations. And we maintain close parity between js and python, so you can work in which ever language you prefer and then port by following existing patterns. We actually don't have a issue filed for this, the closest match would be beautifier/js-beautify#80 . And this issue is unlikely to get fixed here unless/until it gets fixed upstream. So, at very least, you'll want to file an issue over there. |
@bitwiseman That would be an understatement. I learned my lesson once already. I check pull requests much more carefully for jsbeautifier modifications now. @mrchief, I think a formatting option for this would be valuable. However Liam is very correct, we can not make changes to js-beautifier here at the dependency level, as it makes it impossible to easily merge upgrades in the future. I would urge you to submit a pull request (javascript or python port) over at einars/js-beautify, or at least submit an issue. In the meantime I have tagged this as a jsbeautifier feature so we don't loose track of it. If you do so, respond in this thread with a link to the pull request or issue and anyone from here can throw in support/suggestions. |
@jdc0589 Thanks for the explanation. I understand now what Liam meant by his first comment. This makes perfect sense. I'll either submit an issue or send a pull request to upstream! Update: Issue created! beautifier/js-beautify#245 |
It took a while, but the initial implementation of this is available in v1.5.5 of js-beautify. |
Allow code to be formatted like this:
JSBeautifier supports it (or can be tweaked easily): http://stackoverflow.com/questions/10872184/comma-first-js-formatter
https://gist.github.com/nemtsov/2864266
The text was updated successfully, but these errors were encountered: