Skip to content

Commit 3a21709

Browse files
authored
fix(code-generator): upgrade prettier parser from babel to babel-ts, fix some ts parse error (alibaba#2166)
1 parent 3439540 commit 3a21709

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
@@ -21,7 +21,7 @@ const factory: PostProcessorFactory<ProcessorConfig> = (config?: ProcessorConfig
2121
const codePrettier: PostProcessor = (content: string, fileType: string) => {
2222
let parser: prettier.BuiltInParserName | any;
2323
if (fileType === 'js' || fileType === 'jsx' || fileType === 'ts' || fileType === 'tsx') {
24-
parser = 'babel';
24+
parser = 'babel-ts';
2525
} else if (fileType === 'json') {
2626
parser = 'json-stringify';
2727
} else if (PARSERS.indexOf(fileType) >= 0) {

0 commit comments

Comments
 (0)