feat: 🎸 支持对 JSON 文件进行 prettier 格式化

This commit is contained in:
牧毅 2020-08-12 00:33:27 +08:00
parent 42f7bdbe42
commit b7c4854fb1

View File

@ -21,6 +21,8 @@ const factory: PostProcessorFactory<ProcessorConfig> = (config?: ProcessorConfig
parser = 'babel';
} else if (fileType === 'ts' || fileType === 'tsx') {
parser = 'typescript';
} else if (fileType === 'json') {
parser = 'json';
} else if (PARSERS.indexOf(fileType) >= 0) {
parser = fileType as prettier.BuiltInParserName;
} else if (cfg.customFileTypeParser[fileType]){