diff --git a/src/printer.js b/src/printer.js index 2c7fb157ecf7..1dec2400b4bd 100644 --- a/src/printer.js +++ b/src/printer.js @@ -704,10 +704,10 @@ function genericPrintNoParens(path, options, print) { if (props.length === 0) { return group( concat([ - "{", + leftBrace, comments.printDanglingComments(path, options), softline, - "}" + rightBrace ]) ); } else { diff --git a/tests/exact_object/__snapshots__/jsfmt.spec.js.snap b/tests/exact_object/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000000..f2ac21e440e2 --- /dev/null +++ b/tests/exact_object/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"type Props = {||}; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +type Props = {||}; +" +`; diff --git a/tests/exact_object/jsfmt.spec.js b/tests/exact_object/jsfmt.spec.js new file mode 100644 index 000000000000..989047bccc52 --- /dev/null +++ b/tests/exact_object/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname); diff --git a/tests/exact_object/test.js b/tests/exact_object/test.js new file mode 100644 index 000000000000..046279e56bf2 --- /dev/null +++ b/tests/exact_object/test.js @@ -0,0 +1 @@ +type Props = {||};