You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pasting code from documentation, tutorials, stackoverflow, etc. I often have to manually unify the quote style (single-quotes vs. double-quotes) of string literals. It would be super cool if js-beautify had an option for that.
The text was updated successfully, but these errors were encountered:
This is the sort of thing that needs parsed AST (#200), which is unfortunately hard to do with our current algorithm (not to mention Python and JS platform requirements). In the meantime, esprima (via escodegen) demonstrates one way to do this particular kind of transform.
No, there is not progress on this and there is unlikely to be any for sometime. The beautifier is designed to modify only the whitespace of javascript input. This scenario is one that we specifically avoid at this time due to the limitations mentioned above. Also as noted above, there are other projects that might serve you better in this scenario.
We're leaving this open as a possible future enhancement along with other code folding feature requests.
I was able to make some changes to the javascript version to change single quotes to double quotes (or vice versa). It might not work in all cases. See https://gist.github.com/nmalaguti/576d191c4547cdf7e0cb lines 18-21 and 114-119 for the code changes.
When pasting code from documentation, tutorials, stackoverflow, etc. I often have to manually unify the quote style (single-quotes vs. double-quotes) of string literals. It would be super cool if js-beautify had an option for that.
The text was updated successfully, but these errors were encountered: