Skip to content

Commit

Permalink
Don't apply workaround for single line functions, fixes #549
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Dec 31, 2018
1 parent 020d843 commit 9158b17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ module.exports = function(expect) {
isWrappedInBraces = false;
body = matchBodyAndIndent[2];
const matchInitialNewline = openingBrace.match(/^\n( +)/);
if (matchInitialNewline) {
if (matchInitialNewline && /\n/.test(body)) {
// An arrow function whose body starts with a newline, as prettier likes to output, eg.:
// () =>
// foo(
Expand Down

0 comments on commit 9158b17

Please sign in to comment.