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

请问在转换的过程中,可以指定prettier格式吗? #166

Open
AzronChan opened this issue Jun 28, 2022 · 4 comments
Open

请问在转换的过程中,可以指定prettier格式吗? #166

AzronChan opened this issue Jun 28, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@AzronChan
Copy link

AzronChan commented Jun 28, 2022

在使用 gogocode -s src -o src-out -t gogocode-plugin-vue 转换的时候,发现 gogocode-plugin-vue 里的prettier与项目原本用的prettier不一致,导致很多转换后的代码,需要再转换一次;
请问有没有方式,可以指定转换prettier配置文件,比如是 gogocode -s src -o src-out -t gogocode-plugin-vue -p prettierfile=xxxxxxx

@AzronChan AzronChan added the bug Something isn't working label Jun 28, 2022
@kaizige10
Copy link

哈哈哈我和你一样。
我临时改了全局npm包下面的gogocode-plugin-prettiergogocode-plugin-vue的代码,这样再跑一遍就可以了:

    return prettier.format(sourceCode, {
        trailingComma: 'es5',
        tabWidth: 4,
        semi: true,
        singleQuote: true,
        printWidth: 120,
        parser: /\.vue$/.test(fileInfo.path) ? 'vue' : 'typescript',
    });

或者你可以提个PR给他们😁

@AzronChan
Copy link
Author

哈哈哈我和你一样。 我临时改了全局npm包下面的gogocode-plugin-prettiergogocode-plugin-vue的代码,这样再跑一遍就可以了:

    return prettier.format(sourceCode, {
        trailingComma: 'es5',
        tabWidth: 4,
        semi: true,
        singleQuote: true,
        printWidth: 120,
        parser: /\.vue$/.test(fileInfo.path) ? 'vue' : 'typescript',
    });

或者你可以提个PR给他们😁

是的,我也是去npm包里面改了,感人。

@ckangwen
Copy link

提了一个PR #168

@kaizige10
Copy link

提了一个PR #168

大神🐂🍺👍🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants