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 vuejs #1154

Closed
lizhongyi opened this issue Mar 8, 2017 · 12 comments
Closed

support vuejs #1154

lizhongyi opened this issue Mar 8, 2017 · 12 comments

Comments

@lizhongyi
Copy link

lizhongyi commented Mar 8, 2017

Settings

Example:

        case 'scss':
            languageId = 'css';
        case 'css':
            beatiFunc = jsbeautify.css;
            break;
        case 'json':
            languageId = 'javascript';
        case 'javascript':
            beatiFunc = jsbeautify.js;
            break;
        case 'html':
            beatiFunc = jsbeautify.html;
        case 'vue':
            beatiFunc = jsbeautify.html;
            break;
        default:
            showMesage('Sorry, this language is not supported. Only support Javascript, CSS and HTML.');
            break;
@jimmywarting
Copy link

It can just fall through

case 'html':
case 'vue':
    beatiFunc = jsbeautify.html;

@bitwiseman
Copy link
Member

@lizhongyi @jimmywarting
You're writing the code you want? How about about PR?

@bitwiseman bitwiseman reopened this Mar 29, 2017
@bitwiseman
Copy link
Member

@lizhongyi Why closed?

@yoyo837
Copy link

yoyo837 commented Jul 18, 2017

@bitwiseman I think they may not have enough free time, please forgive us. :(

@lonerdottie
Copy link

Any progress on this? Not many tools out there as good as or as widely used as jsbeautify and not supporting Vue is a huge headache.

@bitwiseman
Copy link
Member

@lonerdottie - It looks like this would a straightforward PR. Make the change suggested above, add a few tests. I doubt it would be full support, but it would be something.

@bitwiseman
Copy link
Member

@lonerdottie - Actually, it is unclear to me what part of the code it referred to above. Are you using http://jsbeautifier.org or a specific editor/plugin? What happens to your vuejs code when you put it in http://jsbeautifier.org ?

@lonerdottie
Copy link

@bitwiseman take a look at this code for example and run it through. The obvious issue when running it in jsbeautifier.org is that it ignores everything within the 'template' tag.
https://gist.github.com/lonerdottie/5f47b66dccd8c3ca6a2528adc06fcba4

@bitwiseman
Copy link
Member

@lonerdottie Yeah, we treat template as "unformatted". (see https://github.com/beautify-web/js-beautify/blob/master/js/src/html/beautifier.js#L99) . You could try overriding that setting.

What other issues do you see?

@xorbis
Copy link

xorbis commented Jan 29, 2018

How does one remove the template tag from the unformatted tags for HTML beautifying?
The documentation specifies howto set the tags on the command line but not the .jsbeautifyrc file.

@bitwiseman bitwiseman added this to the v1.8.x milestone Jan 18, 2019
@bitwiseman
Copy link
Member

@xorbis @lonerdottie
I think this is fixed in 1.9.0-beta2 (possibly earlier). Can you take a look?

@xorbis
Copy link

xorbis commented Jan 21, 2019

Can't test on my side we switched to eslint beautifying.

@bitwiseman bitwiseman modified the milestones: v1.9.x, v1.9.0 Feb 27, 2019
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

6 participants