Skip to content

Commit 75a4a80

Browse files
authored
feat(code-gen): 出码生成的*.ts和*.tsx文件使用babel格式化 (alibaba#2088)
1 parent 503793f commit 75a4a80

File tree

1 file changed

+1
-1
lines changed
  • modules/code-generator/src/postprocessor/prettier

1 file changed

+1
-1
lines changed

modules/code-generator/src/postprocessor/prettier/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const factory: PostProcessorFactory<ProcessorConfig> = (config?: ProcessorConfig
2020

2121
const codePrettier: PostProcessor = (content: string, fileType: string) => {
2222
let parser: prettier.BuiltInParserName | any;
23-
if (fileType === 'js' || fileType === 'jsx') {
23+
if (fileType === 'js' || fileType === 'jsx' || fileType === 'ts' || fileType === 'tsx') {
2424
parser = 'babel';
2525
} else if (fileType === 'json') {
2626
parser = 'json-stringify';

0 commit comments

Comments
 (0)