Added flowCommaSeparator option for object types (#3547)

This commit is contained in:
Sam Pepose
2016-11-15 13:43:42 -06:00
committed by Henry Zhu
parent 6a6ec8785b
commit db85bdc3fc
6 changed files with 31 additions and 2 deletions

View File

@@ -274,7 +274,11 @@ export function ObjectTypeAnnotation(node: Object) {
statement: true,
iterator: () => {
if (props.length !== 1) {
this.semicolon();
if (this.format.flowCommaSeparator) {
this.token(",");
} else {
this.semicolon();
}
this.space();
}
}

View File

@@ -63,7 +63,8 @@ function normalizeOptions(code, opts, tokens): Format {
adjustMultilineComment: true,
style: style,
base: 0
}
},
flowCommaSeparator: opts.flowCommaSeparator,
};
if (format.minified) {