Avoid calls to isUserWhitespacable by explicitly marking statement lists.
This commit is contained in:
parent
38b91235cc
commit
5de7433147
@ -251,6 +251,7 @@ export function ObjectTypeAnnotation(node: Object) {
|
||||
|
||||
this.printJoin(props, node, {
|
||||
indent: true,
|
||||
statement: true,
|
||||
iterator: () => {
|
||||
if (props.length !== 1) {
|
||||
this.semicolon();
|
||||
|
||||
@ -38,7 +38,7 @@ export function ObjectExpression(node: Object) {
|
||||
|
||||
if (props.length) {
|
||||
this.space();
|
||||
this.printList(props, node, { indent: true });
|
||||
this.printList(props, node, { indent: true, statement: true });
|
||||
this.space();
|
||||
}
|
||||
|
||||
|
||||
@ -53,11 +53,6 @@ function isOrHasCallExpression(node) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function isUserWhitespacable(node) {
|
||||
return t.isUserWhitespacable(node);
|
||||
}
|
||||
|
||||
export function needsWhitespace(node, parent, type) {
|
||||
if (!node) return 0;
|
||||
|
||||
|
||||
@ -448,7 +448,7 @@ export default class Printer {
|
||||
// Fast path since 'this.newline' does nothing when not tracking lines.
|
||||
if (this.format.retainLines || this.format.compact) return;
|
||||
|
||||
if (!opts.statement && !n.isUserWhitespacable(node, parent)) {
|
||||
if (!opts.statement) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user