feat(code-gen): 出码生成的*.ts和*.tsx文件使用babel格式化 (#2088)

This commit is contained in:
AprChell 2023-05-29 14:11:12 +08:00 committed by GitHub
parent 503793fdfc
commit 75a4a80935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ const factory: PostProcessorFactory<ProcessorConfig> = (config?: ProcessorConfig
const codePrettier: PostProcessor = (content: string, fileType: string) => {
let parser: prettier.BuiltInParserName | any;
if (fileType === 'js' || fileType === 'jsx') {
if (fileType === 'js' || fileType === 'jsx' || fileType === 'ts' || fileType === 'tsx') {
parser = 'babel';
} else if (fileType === 'json') {
parser = 'json-stringify';