Skip to content

Commit

Permalink
feat(code-gen): 出码生成的*.ts和*.tsx文件使用babel格式化 (#2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiZng authored May 29, 2023
1 parent 503793f commit 75a4a80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/code-generator/src/postprocessor/prettier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 75a4a80

Please sign in to comment.