diff --git a/src/printer.js b/src/printer.js index 92123de39..0d6ec0978 100644 --- a/src/printer.js +++ b/src/printer.js @@ -353,7 +353,7 @@ function genericPrintNoParens(path, options, print) { collapsed, concat([ concat(parts), - indent(options.tabWidth, concat([line, body])) + group(indent(options.tabWidth, concat([line, body]))) ]) ]), { shouldBreak: willBreak(body) } diff --git a/tests/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/arrows/__snapshots__/jsfmt.spec.js.snap index 86e369872..3874d7eb6 100644 --- a/tests/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/arrows/__snapshots__/jsfmt.spec.js.snap @@ -52,3 +52,20 @@ const foo = () => { }; " `; + +exports[`short_body.js 1`] = ` +"const initializeSnapshotState = ( + testFile: Path, + update: boolean, + testPath: string, + expand: boolean, +) => new SnapshotState(testFile, update, testPath, expand); +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const initializeSnapshotState = ( + testFile: Path, + update: boolean, + testPath: string, + expand: boolean +) => new SnapshotState(testFile, update, testPath, expand); +" +`; diff --git a/tests/arrows/short_body.js b/tests/arrows/short_body.js new file mode 100644 index 000000000..f7533b94f --- /dev/null +++ b/tests/arrows/short_body.js @@ -0,0 +1,6 @@ +const initializeSnapshotState = ( + testFile: Path, + update: boolean, + testPath: string, + expand: boolean, +) => new SnapshotState(testFile, update, testPath, expand);