Skip to content

Commit

Permalink
Fix: Resolves problem with incorrect component formatting (prettier#8584
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mikoscz committed Jun 18, 2020
1 parent 3cad8b2 commit 1026749
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/language-handlebars/printer-glimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ function print(path, options, print) {
);
}
case "MustacheStatement": {
const shouldBreakOpeningMustache = isParentOfSomeType(path, [
const isParentOfSpecifiedTypes = isParentOfSomeType(path, [
"AttrNode",
"ConcatStatement",
"ElementNode",
]);
const shouldBreakOpeningMustache =
isParentOfSpecifiedTypes && doesNotHaveHashParams(n);

return group(
concat([
Expand Down Expand Up @@ -649,6 +651,10 @@ function locationToOffset(source, line, column) {
}
}

function doesNotHaveHashParams(node) {
return node.hash.pairs.length === 0;
}

module.exports = {
print,
massageAstNode: clean,
Expand Down

0 comments on commit 1026749

Please sign in to comment.